Two trains at speed 60 km/hr comes in the opposite
direction. At a particular time the distance between the
two trains is 18km. A shuttle flies between the trains at
the speed of 80 km/hr. At the time the two trains crashes
what is the distance traveled by shuttle?
You have a sheet cake. There is a rectangular piece missing
from the inside of the sheet cake. The location of the
missing piece is arbitrary. I was told I could assume I had
the means to make the cuts. How do you divide the sheet
cake into 2 even proportions with 2 cuts?
On the shelf you have 10 identical bottles of identical
pills (let?s say there?s a hundred pills in each bottle).
However, one of those 10 bottles contains cheap knockoff
pills. The only way to differentiate fake pills from real
pills is the weight - while real pills weigh 1 g each, the
knockoff pills are only 0.9 g. You have one scale that
shows the exact weight (down to the mg) of whatever is
weighed.
How can you tell which bottle contains fake pills with just
1 weighing?
Substitute digits for the letters to make the following
subtraction problem true.
S A N T A
- C L A U S
-----------------
X M A S
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 M, no other
letter can be 3 and all other M in the puzzle must be 3.
There are 4 mathematicians - Brahma, Sachin, Prashant and
Nakul - having lunch in a hotel. Suddenly, Brahma thinks of
2 integer numbers greater than 1 and says, "The sum of the
numbers is..." and he whispers the sum to Sachin. Then he
says, "The product of the numbers is..." and he whispers the
product to Prashant. After that following conversation takes
place :
Sachin : Prashant, I don't think that we know the numbers.
Prashant : Aha!, now I know the numbers.
Sachin : Oh, now I also know the numbers.
Nakul : Now, I also know the numbers.
What are the numbers? Explain your answer.
Yesterday in a party, I asked Mr. Shah his birthday. With a
mischievous glint in his eyes he replied. "The day before
yesterday I was 83 years old and next year I will be 86."
Can you figure out what is the Date of Birth of Mr. Shah?
Assume that the current year is 2000.
Mr. D'souza has bought four cars - Merc, Honda, Ford, Zen -
as presents for his sons' birthdays, all of which are next
week. Given the following information, what will each son get?
Alan will not get the Honda unless Barry gets the Merc and
Denzil gets the Ford. Barry will not get the Ford unless
Carl gets the Zen and Alan gets the Merc. Denzil will not
get the Zen unless Alan gets the Honda and Barry gets the
Merc. Alan will not get the Merc unless Carl gets the Zen
and Denzil gets the Ford. Barry will not get the Merc unless
Alan gets the Zen and Denzil gets the Ford. Alan will not
get the Zen unless Barry gets the Honda and Carl gets the
Merc. Carl will not get the Zen unless Barry gets the Honda
and Alan gets the Ford. Alan will not get the Ford unless
Barry gets the Zen and Denzil gets the Honda. Carl will not
get the Merc unless Denzil gets the Honda.
? A is the father of two children - B and D who are of
different sexes.
? C is B's spouse.
? E is the same sex as D.
? B and C have the two children - F who is the same sex as B
and G who is the same sex as C.
? E's mother, H who is married to L, is the sister of D's
mother, M.
? E and E's spouse, I have two children - J and K who are
the same sex as I.
Note that no persons have married more than once. Also,
there are more number of females than males. Can you tell
how many females are there?
Father's age is three years more than three times the son's
age. After three years, father's age will be ten years more
than twice the son's age.
What is the father's present age?
In training for a competition, you find that swimming
downstream (with the current) in a river, you can swim 2
miles in 40 minutes, & upstream (against the current), you
can swim 2 miles in 60 minutes.
How long would it take you to swim a mile in still water?
Annie, Bunnie, Candy and Dina visited Edy on 14th February.
1. The time of each visit was as follows:
- Annie at 8:00
- Bunnie at 9:00
- Candy at 10:00
- Dina at 11:00
Each time mentioned above may be either AM or PM.
2. Candy did not visit Edy between Bunnie and Dina.
3. At least one female visited Edy between Annie and Bunnie.
4. Annie did not visit Edy before both Candy and Dina.
Can you tell at what time did they individually visit Edy?
An orange colored glass has Orange juice and white colored
glass has Apple juice both of equal volumes. 50ml of the
orange juice is taken and poured into the white glass. After
that similarly, 50ml from the white glass is poured into the
orange glass.
Of the two quantities, the amount of apple juice in the
orange glass and the amount of orange juice in the white
glass, which one is greater and by how much?
Four men - Abraham, Bobby, Clinton and Denial - are standing
in a straight line.
1. One man is fair, handsome and unscarred.
2. Two men who are not fair, are each standing next to Abraham.
3. Bobby is the only man standing next to exactly one
handsome man.
4. Clinton is the only man not standing next to exactly one
scarred man.
Who is fair, handsome and unscarred?
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