Here is the family tree of Mr. RAHUL
RAHUL
|
---------------------------------------------
| | | |
RATISH YASH OM TRILOK
| | ?
-------- ------------------
| | | | |
AMAR AMIT RAM HARSH ASHOK
| |
----- -------
| | | | |
How many children does Mr. TRILOK have?
Substitute digits for the letters to make the following
Division true
Y F Y
-----------
A Y | N E L L Y
| N L Y
----------------
P P L
P N H
----------
N L Y
N L Y
----------
0 0 0
Note that the leftmost letter can't be zero in any word.
Also, there must be a one-to-one mapping between digits and
letters. e.g. if you substitute 3 for the letter N, no other
letter can be 3 and all other N in the puzzle must be 3.
A group of friends went on a holiday to a hill station. It
rained for 13 days. But when it rained in the morning, the
afternoon was lovely. And when it rained in the afternoon,
the day was preceded by clear morning.
Altogether there were 11 very nice mornings and 12 very nice
afternoons. How many days did their holiday last?
Makayla had $1.19 in change. None of the coins was a dollar.
Nicole ask her for change for a dollar, but Makayla could
not make change.
What coins did she have?
John lives in "Friends Society" where all the houses are in
a row and are numbered sequentially starting from 1. His
house number is 109.
Jessy lives in the same society. All the house numbers on
the left side of Jessy's house add up exactly the same as
all the house numbers on the right side of her house.
What is the number of Jessy's house? Find the minimal
possible answer.
A woman took a certain number of eggs to the market and sold
some of them.
The next day, through the industry of her hens, the number
left over had been doubled, and she sold the same number as
the previous day.
On the third day the new remainder was tripled, and she sold
the same number as before.
On the fourth day the remainder was quadrupled, and her
sales the same as before.
On the fifth day what had been left over were quintupled,
yet she sold exactly the same as on all the previous
occasions and so disposed of her entire stock.
What is the smallest number of eggs she could have taken to
market the first day, and how many did she sell daily? Note
that the answer is not zero.
A rich man died. In his will, he has divided his gold coins
among his 5 sons, 5 daughters and a manager.
According to his will: First give one coin to manager. 1/5th
of the remaining to the elder son. Now give one coin to the
manager and 1/5th of the remaining to second son and so
on..... After giving coins to 5th son, divided the remaining
coins among five daughters equally.
All should get full coins. Find the minimum number of coins
he has?
Shahrukh speaks truth only in the morning and lies in the
afternoon, whereas Salman speaks truth only in the afternoon
and lies in the morning.
A says that B is Shahrukh.
Is it morning or afternoon and who is A - Shahrukh or Salman?
It is Afternoon and A can be Salman or Shahrukh. If A is
Salman, he is speaking truth. If A is Shahrukh, he is lying.
Want to confirm it? Consider following 4 possible answers
and check for its truthness individually.
Four prisoners escape from a prison.
The prisoners, Mr. East, Mr. West, Mr. South, Mr. North head
towards different directions after escaping.
The following information of their escape was supplied:
? The escape routes were North Road, South Road, East Road
and West Road
? None of the prisoners took the road which was their namesake
? Mr. East did not take the South Road
? Mr.West did not the South Road
? The West Road was not taken by Mr. East
What road did each of the prisoners take to make their escape
Once a week a wagon driver leaves his hut and drives his
wagon to the river dock to pick up supplies for his town. At
4:05 PM, one-fifth of the way to the dock, he passes the
Temple. At 4:15 PM, one-third of the way, he passes the
Preetam-Da-Dhabaa.
At what time does he reached the dock?
You have 9 marbles. 8 marbles weigh 1 ounce each, & one
marble weighs 1.5 ounces. You are unable to determine which
is the heavier marble by looking at them. You have a
weighing scale that consists of 2 pans, but the scale is
only good for 2 total weighings.
How can you determine which marble is the heaviest one using
the scale & in 2 weighings?
Gomzi has 3 timepieces in his house - a wall clock, an alarm
clock and a wristwatch. The wristwatch is always accurate,
whereas the wall clock gains 2 minutes everyday and the
alarm clock loses 2 minutes everyday.
At exactly midnight last night, all three watches were
showing the same time.
If today is 25 July 2003, then on which date all three
clocks will show the same time again?
A, B and C are three points on a straight line, not
necessarily equidistant with B being between A and C. Three
semicircles are drawn on the same side of the line with AB,
BC and AC as the diameters. BD is perpendicular to the line
ABC, and D lies on the semicircle AC.
If the funny shaped diagram between the three semicircles
has an area of 1000 square cms, find the length of BD.
Given a sequence of integers, there are a few sequences
which result in balanced
binary search trees i.e., AVL trees. Write a program that
takes a sequence of integers
as input and outputs the number of such sequences that
result in the balanced binary
search trees.
Input Format:
Single line contains sequence of integers terminated by -1.
Output format:
Print the number of AVL tree possible from that input sequence.
Sample Input:
1 2 3 -1
Sample Output:
2
Given an N × N array of positive and negative integers, find
the sub-rectangle with
the largest sum. The sum of a rectangle is the sum of all
the elements in that rectangle.
In this problem the sub-rectangle with the largest sum is
referred to as the maximal
sub-rectangle. A sub-rectangle is any contiguous sub-array
of size 1 × 1 or greater
located within the whole array.
Input Format:
First line contains the size of matrix.
Followed by n lines and each line contain n integers
separated by space.
Output format:
Single integer which represents maximum sum of rectangle.
Sample Input:
4
0 -2 -7 0
9 2 -6 2
-4 1 -4 1
-1 8 0 -2
Sample Output:
15