|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||512 MB||1||1||1||100.000%|
There are $t$ students studying in the best university of Berland. They only study programming in Berland, so there is only one subject. Each student must attend the lectures.
The entire course consists of $n$ lectures. It is known that a student who visits at least $k$ of them will pass the course.
There are only two auditoriums in the university, one has space for $a$ people and the other one --- for $b$ people. To make it comfortable, the administration decided that in odd weeks the lectures will be in the first auditorium, and in the even weeks --- in the second auditorium. So the first lecture will be in the 1-st auditorium, the second lecture in the 2-nd one, the third in the 1-st one again, and so on.
The sizes of the auditoriums are small so it might not be possible for all students to attend at least $k$ lectures. They ask you to count the maximum number of students that can pass the course.
The first line contains five integers:
The limits are: $1 \leq t, n, a, b, k \leq 10^9$.
Print a single integer --- the maximal number of students that can attend at least $k$ lectures and thus pass the course.
10 3 4 4 3
10 3 4 4 5
100000 100000 100000 100000 1
5 4 5 3 3
100 9 6 3 6
In the fourth sample, 5 students can pass the course. Here's one possible strategy:
This way each of these 5 students can attend at least 3 lectures.