Clock
Tag(s):

Problem
Editorial
Analytics

Given the time on the clock and the radius of the clock calculate the number of integral points that lie between the minute hand and the hour hand within the clock.

NOTE: To choose the sector take the clockwise angle from the minute hand to the hour hand.You have to also include the points that lie on the two hands and on the boundary of the sector. The clock is a cirlce of radius R.

INPUT:

The input consists of three space seperated integers H, M and R. H and M denote the time on the clock. R is the radius of the clock. (0,0) is the centre of the clock.

CONSTRAINTS:

$0 \le H \le 12$

$0 \le M\le 60$

$1 \le R \le 1000$

Problem setter : Sheldon Tauro

SAMPLE INPUT
3 0 2
SAMPLE OUTPUT
6
Explanation

In the above testcase the points that lie between the clockwise angle from the minute to hour hand are:

1. (0,0)

2. (0,1)

3. (0,2)

4. (1,0)

5. (2,0)

6. (1,1)

Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, C++17, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, Java 14, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, Python 3.8, R(RScript), Racket, Ruby, Rust, Scala, Swift-4.1, Swift, TypeScript, Visual Basic

## CODE EDITOR

Initializing Code Editor...

## This Problem was Asked in

Challenge Name

Codemania 2.0

OTHER PROBLEMS OF THIS CHALLENGE
• Algorithms > Dynamic Programming
• Data Structures > Arrays
• Math > Number Theory
• Algorithms > Dynamic Programming
• Algorithms > Graphs
• Basic Programming > Input/Output
• Data Structures > Disjoint Data Structures