#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 nn movies, and each page of the website displays kk 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 nn, kk, cc (1n,k,c104)(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 tt, 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 2020 movies and 33 movies on each page except the last one, so there are 22 movies on the last page, and watching those two movies will take a total of 120120 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.