"The E.I.C. was like a box of chocolate - we never knew what we would get..." |
Adapted after "The Teachings of Forrest Gump" |
5 2 1 3 8 6 8 1 2 2 4 6 5 2 9the turning to + of the switch of the element in the position (2,3) leads to the board:
5 2 2 3 8 6 9 2 3 2 4 6 6 2 9and then, after turning to - the switch of the element in the position (1,4) the following board is obtained:
5 2 1 2 7 6 9 2 2 2 4 6 6 2 9
m n x - m,n - the board dimensions, x - the final value; a a .. a - the initial configuration of the board; 11 12 1n a a .. a (in a line, all the numbers are separated by a space) 21 22 2n ..... a a .. a m1 m2 mn
k - the number of moves p i j - (i , j ) are the coordinates of the switcher 1 1 1 s s p i j activated during the move s; 2 2 2 p has one of the values "+" or "-" (1 <= s <= k); ........ s p i j k k k
RUBIK.IN 4 4 2 2 3 2 3 3 2 2 2 3 3 1 3 3 3 3 3 RUBIK.OUT 5 + 2 3 - 4 4 - 1 4 - 2 2
MA MA#MIA 0 coresponds with M 00 coresponds with A 01 coresponds with space character ' ' 10 coresponds with the second M ...
COD.IN ECO IKUT 00101011000111010 00100111011001111000 NUSBECOT 0100100110110010010001110100111000 COD.OUT EIC OK SUCCES
n // representing the number of points existing in the plane; a b 1 1 // in the next n lines, the coordinates of the points a b in the plane are given, separated by a space; 2 2 ... a b n n
a b a b a b // representing the coordinates of the points forming i i j j k k a triangle with a minimum surface.
ARIE.IN 4 2 2 4 2 -3 -1 -2 4 ARIE.OUT -2 4 2 2 4 2