Company: TCS codevita
Difficulty: medium
Learning With Clock-2 Deva recently learned about angles in his mathematics class and is eager to explore them further! He began learning about angles using a wall clock. He chose an ancient wall clock for his learning. This clock has only two hands: the hour hand and the minute hand. The hour hand moves to the next hour only after the minute hand completes a full rotation, staying at the current hour until then. The task is to form a given angle between the two hands of the clock. The rules for forming the angle are as follows: Starting from the given position, you can move both hands, but in opposite directions without crossing each other. For example, if you move the hour hand clockwise, you must move the minute hand counterclockwise, and vice versa. The hour hand can only be moved from one hour to the next or previous hours; it cannot be positioned between the hours. However, there are no such restrictions for the minute hand. Moving a hand clockwise incurs a cost of R rupees while