zobayer RMSTU Bangabandhu Online...
Limits 1s, 512 MB

Given two clocks with no digits printed on them and only two hands, one smaller for hour and one bigger for minute, you have to determine whether the two clocks are visually distinguishable. You will have the timestamps for each clock.

Note that, we don’t want to distinguish between angles with a difference less than 0.05, i.e., two angles a and b will be considered equal if and only if |a-b| < 0.05.


The first line will contain an integer T (T <= 3*10^5), the number of test cases. Next T lines will contain 6 integers h1, m1, s1, h2, m2, and s2 as shown in sample input. Here h, m and s are the hour, minute and second of the timestamps. All times will be valid and in a 24-hours time format. All times will be given in such a way that the difference angle between the hands will be approximately around some multiple of 10.


For each test case, print the test case serial and “Yes” if the clock states are distinguishable, else print “No”. Check sample output for details.


0:16:22 0:49:6
1:21:50 2:27:17
Case 1: Yes
Case 2: No

Judge solution uses an EPS value of 1e-9.


Login to submit.


47% Solution Ratio
Hamim_CuetEarliest, May '21
Deshi_TouristFastest, 0.1s
Hamim_CuetLightest, 4.2 MB
BerlekampMassyShortest, 525B
Toph uses cookies. By continuing you agree to our Cookie Policy.