SAC '22 Code Challenge 1 P1 - That Teacher

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type

Mr. Prezens is a very generous man. To show his generosity for his neighbourhood, he has decided to give each of N trick-or-treaters M candy bars.

If Mr. Prezens has C candy bars, how many candy bars will he have leftover for himself after giving each trick-or-treater M candy bars?

Input Specification

The first line will contain an integer, N (0 \le N \le 100\,000), the number of trick-or-treaters he has.

The second line will contain an integer, M (0 \le M \le 100\,000), the number of candy bars he gives to each trick-or-treater.

The third line will contain an integer, C (M \le C \le 500\,000), the number of candy bars he has.

Note: Mr. Prezens will always have at least enough candy bars for all trick-or-treaters.

Output Specification

Output the number of candy bars he will have left.

Sample Input

10
1
15

Sample Output

5

Comments


  • 0
    Viv_CCGS  commented on March 20, 2024, 7:04 a.m.

    Petition to rename this problem "The Return of A times B". Upvote if you agree.


  • -1
    ElvisChen2011  commented on March 19, 2024, 8:40 p.m.

    easiest problem after "Hello, World!"