Berland University

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

There are tt 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 nn lectures. It is known that a student who visits at least kk of them will pass the course.

There are only two auditoriums in the university, one has space for aa people and the other one --- for bb 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 kk lectures. They ask you to count the maximum number of students that can pass the course.

입력

The first line contains five integers:

  • tt --- the number of students;
  • nn --- the number of lectures;
  • aa --- the size of the first auditorium;
  • bb --- the size of the second auditorium;
  • kk --- the minimal number of lectures to pass the course.

The limits are: 1t,n,a,b,k1091 \leq t, n, a, b, k \leq 10^9.

출력

Print a single integer --- the maximal number of students that can attend at least kk lectures and thus pass the course.

힌트

In the fourth sample, 5 students can pass the course. Here's one possible strategy:

  1. Students 11, 22, 33, 44, 55 visit the first lecture.
  2. Students 11, 33 visit the second lecture.
  3. Students 11, 22, 33, 44, 55 visit the third lecture.
  4. Students 22, 44, 55 visit the fourth lecture.

This way each of these 5 students can attend at least 3 lectures.