Six cabins numbered 1-6 consecutively, are arranged in a row
and are separated by thin dividers. These cabins must be
assigned to six staff members based on following facts.
1. Miss Shalaka's work requires her to speak on the phone
frequently throughout the day.
2. Miss Shudha prefers cabin number 5 as 5 is her lucky number.
3. Mr. Shaan and Mr. Sharma often talk to each other during
their work and prefers to have adjacent cabins.
4. Mr. Sinha, Mr. Shaan and Mr. Solanki all smoke. Miss
Shudha is allergic to smoke and must have non-smokers
adjacent to her.
5. Mr. Solanki needs silence during work.
Can you tell the cabin numbers of each of them?
SlowRun Express runs between Bangalore and Mumbai, For the
up as well as the down journey, the train leaves the
starting station at 10:00 PM everyday and reaches the
destination at 11:30 PM after three days.
Mr. Haani once travelled by SlowRun Express from Mumbai to
Bangalore. How many SlowRun Express did he cross during his
journey?
Dr. DoLittle always goes walking to the clinic and takes the
same time while going and while coming back. One day he
noticed something.
When he left the home, the hour hand and the minute hand
were exactly opposite to each other and when he reached the
clinic, they were together.
Similarly, when he left the clinic, the hour hand and the
minute hand were together and when he reached the home, they
were exactly opposite to each other.
How much time does Dr. DoLittle take to reach home from the
clinic? Give the minimal possible answer.
Mr. Black, Mr. White and Mr. Grey were chatting in the Yahoo
conference. They were wearing a black suit, a white suit and
a grey suit, not necessarily in the same order.
Mr. Grey sent message, "We all are wearing suit that are of
the same color as our names but none of us is wearing a suit
that is the same color as his name."
On that a person wearing the white suit replied, "What
difference does that make?"
Can you tell what color suit each of the three persons had on?
Veeru says to Jay, "Can you figure out how many Eggs I have
in my bucket?" He gives 3 clues to Jay: If the number of
Eggs I have
1. is a multiple of 5, it is a number between 1 and 19
2. is not a multiple of 8, it is a number between 20 and 29
3. is not a multiple of 10, it is a number between 30 and 39
How many Eggs does Veeru have in his bucket?
How many possible combinations are there in a 3x3x3 rubics
cube?
In other words, if you wanted to solve the rubics cube by
trying different combinations, how many might it take you
(worst case senerio)?
How many for a 4x4x4 cube?
Two identical pack of cards A and B are shuffled throughly.
One card is picked from A and shuffled with B. The top card
from pack A is turned up. If this is the Queen of Hearts,
what are the chances that the top card in B will be the King
of Hearts?
Somebody marked the six faces of a die with the numbers 1, 2
and 3 - each number twice. The die was put on a table. Four
people - Abu, Babu, Calu and Dabu - sat around the table so
that each one was able to see only three sides of the die at
a glance.
? Abu sees the number 1 and two even numbers.
? Babu and Calu can see three different numbers each.
? Dabu sees number 2 twice and he can't remember the third
number.
What number is face down on the table?
Montu, Bantu, Chantu and Pintu have pets.
Montu says, "If Pintu and I each have a dog, then exactly
one of Bantu and Chantu has a dog."
Bantu says, "If Chantu and I each have a cat, then exactly
one of Montu and Pintu has a dog."
Chantu says, "If Montu and I each have a dog, then exactly
one of Bantu and Pintu has a cat."
Pintu says, "If Bantu and I each have a cat, then exactly
one of Bantu and I has a dog."
Only one of the four is telling the truth. Who is telling
the truth?
Karan bought a little box of midget matches, each one inch
in length. He found that he could arrange them all in the
form of a triangle whose area was just as many square inches
as there were matches.
He then used up six of the matches, and found that with the
remainder he could again construct another triangle whose
area was just as many square inches as there were matches.
And using another six matches he could again do precisely
the same.
How many matches were there in the box originally?
Note that the match-box can hold maximum of 50 matches.
Mrs. Watsherface had a garage sale. A custmer named Gina
bought an old lamp and a rug. She paid a total of $5.25 for
everything. The rug cost 25 cents more than the lamp.
How much did each cost?
All of the students at a college are majoring in psychology,
business, or both. 73% of the students are psychology
majors, & 62% are business majors.
If there are 200 students, how many of them are majoring in
both psychology & business?
An emergency vehicle travels 10 miles at a speed of 50 miles
per hour.
How fast must the vehicle travel on the return trip if the
round-trip travel time is to be 20 minutes?
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