#7391. [UOI 2025 II Stage] Movies

[UOI 2025 II Stage] Movies

[UOI 2025 II Stage] Movies

题目描述

Deadpool is watching movies about Wolverine from different universes on a multiverse movie website. It is known that there are a total of $n$ movies, and each page of the website displays $k$ different movies (with the last page showing all remaining ones). Deadpool doesn't have much time, so he goes straight to the last page and watches all the movies from it.

Each movie lasts exactly cc minutes. How much time did he spend watching the movies?

输入格式

The first line contains three integers $n$, $k$, $c$ $(1 \le n, k, c \le 10^4)$ --- the number of movies, the number of movies on one page, and the duration of one movie.

输出格式

Output a single number $t$, the amount of time that Deadpool will spend watching the movies.
20 3 60
120
65 10 30
150
100 20 90
1800

提示

In the first example, we have $20$ movies and $3$ movies on each page except the last one, so there are $2$ movies on the last page, and watching those two movies will take a total of $120$ minutes.

In the second example, there are a total of 6565 movies and 1010 movies per page, so there will be 55 movies on the last page, and watching them will take 150150 minutes.

In the third example, there are 100100 movies, with 2020 movies per page, so there will be 2020 movies on the last page, and Deadpool will watch them for 18001800 minutes. 标签: P15090|数学|2025|UOI(乌克兰)

来源

P15090|[UOI 2025 II Stage] Movies