<PREV Problem:
NEXT>
Solved by 264 users: ...
UserDateAttemptTimeCMSC
Philip_PV26 jul 2008C++300.01230 
kil11 jul 2007Ruby200.03261 
Philip_PV26 jul 2008C++200.01262 
kornakovBSU25 sep 2010C++800.01264 
vitekkk11 mar 2005FPC1?.??264 
Anju7a05 apr 2006C++100.02266 
BobicZdoh03 mar 2006C++100.02274 
grom14 oct 2004FPC1?.??277 
Wind_Love19 mar 2008C++400.01278 
kornakovBSU25 sep 2010C++700.01278 
JohnJones_00124 may 2006C++100.02283 
Huang_SR04 jul 2006C++100.02283 
Languages
C++
140
FPC
69
C
26
Kylix
15
Java
12
Ruby
2
Python
1
Perl
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 = 3.228.10.17