To move a safe, two cylindrical steel bars 7 cms in
diameter are used as rollers. How far will the safe move
forward when the rollers have made one revolution?
A ship went on a voyage. After it had travelled 180 miles a
plane statrted with 10 times the speed of the ship. Find
the distance when they meet from starting point.
Three friends divided some bullets equally. After all of
them shot 4 bullets the total number of bullets remaining
is equal to the bullets each had after division. Find the
original number divided.
Four persons A, B, C and D are playing cards.Each person
has one card, laid down on the table below him, which has
two different colours on either side. The colours visible
on the table are Red, Green, Red and Blue. They see the
color on the reverse side and give the following
There are 8 stones which are similar except one which is
heavier than the others. To find it, you are given a pan
balance. What is the minimal number of weighing needed to
find out the heaviest stone ?
There are 3 lights (in one room) and 3 swtiches (in another
room), one for each, if you only enter into the light room
once. How can you find out which switch corresponds to which
light?
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
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