TCS
Company
Numerical Ability
Area and Volume
A rectangle of height 100 squares and width 200 squares. Squares is drawn on a graph paper. It is colored square by square from top left corner and moving across in a spiral turning right. Whenever a side of this rectangle or a colored square is reached. Which square is colored last (give its row and column numbers). The bottom right square is on row 100, column 200?
a) 51,150
b) 51, 50
c) 50, 150
d) 50, 50
Read Solution (Total 7)
-
- last square to be coloured is (51, 50)
check
For (4, 8) rectangle, ends at (3, 2)
Likewise,
For (2, 4) rectangle, ends at (2, 1)
For (3, 6) rectangle, ends at (2, 5)
For (4, 8) rectangle, ends at (3, 2)
For (5, 10) rectangle, ends at (3, 8)
For (6, 12) rectangle, ends at (4, 3)
For (7, 14) rectangle, ends at (4, 11)
For (8, 16) rectangle, ends at (5, 4)
For (9, 18) rectangle, ends at (5, 14)
For (10, 20) rectangle, ends at (6, 5)
Analyzing the above 10 points:
We can get some idea that,
For Even number of rows, End points column increases 1 by previous column.
For Odd number of rows, End points column difference of the present column and the previous even number column.
For End point row, the value repeats two times from row 2.
In our problem, (100, 200) i.e.
Even number row,
So End point column value must be 50 for 200 columns and End point row value must be 51 for 100 rows.
For even number of rows and columns,
Condition: Column =2*Row
Endpoint (R, C) = {((Row/2) +1), Column/4}
so last square to be coloured is (51, 50) - 12 years agoHelpfull: Yes(20) No(4)
- for a rectangle of m*n dimension we will stop at (m/2+1,n/4) place i.e (100/2+1, 200/4)
(51,50) - 9 years agoHelpfull: Yes(10) No(0)
- sorry for previous solution actual solution is (51,50)
since in every round 2 rows(top+bottom) & 2 columns(left+rht) are covered
after 50 rounds 100 rows & 100 columns r covered
see eg below
ROUND ROWS COLUMNS ENDROW ENDCOLMN
1 2 2 2 1
2 4 4 3 2
3 6 6 4 3
- - - - -
- - - - -
50 100 100 51 50
50 100 101 51 50
50 100 200 51 50
YOU CAN DRAW ON PAPER TO CONFIRM - 12 years agoHelpfull: Yes(6) No(3)
- Ans: 51,150
- 12 years agoHelpfull: Yes(3) No(15)
- for even no of rows and columns
the formula derived is (R/2+1, C/4)
SO (100/2+1, 200/40=(51,50) - 7 years agoHelpfull: Yes(3) No(1)
- Ans: b)51,50
- 12 years agoHelpfull: Yes(1) No(6)
- for even no of rows and columns
the formula derived is (R/2+1, C/4)
SO (100/2+1, 200/40=(51,50) - 5 years agoHelpfull: Yes(0) No(0)
TCS Other Question