#P15090. [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 movies, and each page of the website displays 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 minutes. How much time did he spend watching the movies?
输入格式
The first line contains three integers , , --- the number of movies, the number of movies on one page, and the duration of one movie.
输出格式
Output a single number , 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 movies and movies on each page except the last one, so there are movies on the last page, and watching those two movies will take a total of minutes.
In the second example, there are a total of movies and movies per page, so there will be movies on the last page, and watching them will take minutes.
In the third example, there are movies, with movies per page, so there will be movies on the last page, and Deadpool will watch them for minutes.