TCS
Company
Given a 9 x 14 chessboard, a rook is placed at the lower left corner. Players A and B take turns moving the rook. A plays first and each turn consists of moving the rook horizontally to the right or vertically above. The last person to make a move wins the game. At the completion of the game, the rook will be at the top right corner. For example, the figure below shows a 3 x 4 chessboard and the sequence of moves that leads to a win for player A.
What is a winning first move for A (in the given 9 x 14 chessboard) ?
Read Solution (Total 4)
-
- is this asked in tcs written test...?? pls tell me... 2maro tcs written test for us...
- 12 years agoHelpfull: Yes(31) No(4)
- A will win if he took the second turn because the player took first turn will loose. And if A want to win then his first turn should be horizontally right or last turn should be vertically up and in each turn he has to cover only 1 box.
- 12 years agoHelpfull: Yes(6) No(0)
- who takes the first turn always they will win.
A in order to win he has to take the first chance
- 12 years agoHelpfull: Yes(2) No(0)
- i will make 6 steps to right to assure my win . and thats correct . mind it !
- 11 years agoHelpfull: Yes(0) No(0)
TCS Other Question
Cubes C1, C2, C3... and spheres S1, S2, S3... are defined in the following way.
• S1 has radius 1cm.
• For each n > 0, Cn is inscribed in Sn and Sn+1 is inscribed in Cn (i.e. C1 is inscribed in S1, S2 is inscribed in C1, C2 is inscribed in S2 and so on).
Let Vn be the sum of the volumes of the first n cubes C1, C2,..., Cn. Then as n → ∞ Vn approaches
•
• 4(1+3√3)/13
•
• 2(1+3√3)/13
•
• ∞, i.e. Vn is unbounded
•
• 1(1+3√3)/13
•
• 6(1+3√3)/13
a = 16, b = 15, c = 3
if (c divides a) {
if (b > c) {
x = 1
} else {
x = 2
}
} else {
if (c divides b) {
x = 3
} else {
x = 4
}
}