## Max's Anger Contest Series 1 P1 - Hunger Bar

View as PDF

Points: 3 (partial)
Time limit: 0.1s
Java 0.2s
Python 0.2s
Memory limit: 256M

Author:
Problem type

Since Bob has been playing too much Minecraft, he has been viewing everything in terms of Minecraft, including whenever he is hungry.

He visualizes this hunger with a hunger bar with hunger points. If he eats apples, he will gain at most hunger points since he only has at most hunger points.

To further this visualization, Bob will lose hunger point every second.

He cannot have negative hunger points.

Initially, he has hunger points when he eats the apples.

After eating the apples instantly, he will wait seconds and wants to know the state of his hunger bar.

Can you help him determine his remaining hunger points?

#### Input Specification

The first line will contain an integer, , the number of hunger points he has available.

The second line will contain an integer, , the number of apples he will eat.

The third line will contain an integer, , the number of seconds he will wait.

#### Output Specification

Output the number of hunger points he will have after eating apples and waiting seconds.

#### Sample Input 1

5
3
1

#### Sample Output 1

2

#### Explanation for Sample 1

Bob eats the apples and gains hunger points. Then, he waits for second and loses hunger point, resulting in hunger points.

#### Sample Input 2

10
20
5

#### Sample Output 2

5

#### Explanation for Sample 2

Bob eats the apples and gains hunger points since he only has hunger slots. Then, he waits for seconds and loses hunger points, resulting in hunger points.

#### Sample Input 3

1
50
1000

#### Sample Output 3

0

#### Explanation for Sample 3

Bob eats the apples and gains hunger point since he only has hunger slot. Then, he waits seconds and loses hunger point, resulting in hunger points.