NC206794. RendezvousonaTetrahedron
描述
输入描述
The input consists of a single test case, formatted as follows.XW YW (W = P, Q) is the first edge the worm W crossed after its start. XW YW is one of BC,CD or DB.An integer dW (1 ≤ dW ≤ 59) is the angle in degrees between edge AXW and the initial directionof the worm W on the face △XWYW .An integer lW (1 ≤ lW ≤ 20) is the length of the trail of worm W left on the surface, in unitlengths.
输出描述
Output YES when and only when the two worms stopped on the same face of the tetrahedron.Otherwise, output NO.
示例1
输入:
CD 30 1 DB 30 1
输出:
YES
示例2
输入:
BC 1 1 DB 59 1
输出:
YES
示例3
输入:
BC 29 20 BC 32 20
输出:
NO