<PREV Problem:
NEXT>
Solved by 264 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Two cubes

Time limit = 5

There are two cubes with integer number on each side. These numbers are from the set {1, 2, .. 1000}. Numbers on different sides can be the same.

Your program should detect whether these cubes are

If two cases 1) and 2) have took place together then consider this situation as 1).

Input Two cube descriptions. Cube descripition is the list of six numbers delimited with "white space". These numbers are numbers on the cube sides given in the following order:

"White space" is spaces, tab symbols, line ends.

Output Your program should output one line with one number:
1, if cubes are equal
2, if cubes are reflections of each other,
0, otherwise.

Input#1
  1
2 3 4
  5
  6

  5
2 6 4
  1
  3
Output#1
1

Author:
Dmitry Korolev

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 54.162.181.75