Hello Guys... I got stuck on a problem and need a hint for this problem.

Parag has an old watch. It has only two hands of the minute and hour. Two hands rotate around the center of the circle, indicating hours and minutes. The clock has 60 marks placed around its perimeter, with the distance between consecutive marks being constant. The minute hand moves from its current mark to the next exactly once every minute. The hour hand moves from its current mark to the next exactly once every 12 minutes, so it advances five marks each hour. As you know at 03:00 or 09:00 it creates a 90 degree angle. At 02:00 or 10:00 it creates a 60 degree angle. But this hands never creates a 65 degree angle.

As Parag loves geometry a lot he creates a technique to find either the angle is in between hands or not. Your task is to find the technique of Parag

The Input The Input file contains several cases. Each case contains an integer which denotes the angle, A (0 <= A <= 180). Input is terminated by EOF.

The Output For each line of input print “Y” if the angle in between the motions and “N” if not with their case number in a separate line.

Sample Input 60 65 90

Sample Output Case 1: Y Case 2: N Case 3: Y

problem link : http://school.outsbook.com/problems/problemdetails/368

I tried This Claculation mathod to find all 0-180 degree value, and they exists. So where is the catch? Thank you.

Hands only move on exactly one tick every 1 or 12 minutes, they don't move on fractions of ticks.

Thank you. Can you please explain why 65 degree is not a valid angle?

it's not a multiple of six

Thank you.. I get it now :)