Distinct Products
题号:NC294479
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given two integers a and b, you can perform the following operations with given costs:
  • Increase a by 1 at cost X.
  • Increase b by 1 at cost Y.
You have a total budget of P. Determine how many distinct values of a \times b can get if the total cost is not higher than P.

输入描述:

Five integers a, b, X, Y, P (1 \le a, b, X, Y, P \le 100).

输出描述:

An integer denoting the number of distinct values of a \times b you can get.
示例1

输入

复制
2 3 1 2 6

输出

复制
11

备注: