Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
214 B
2
Indexable
Never
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
	int a, b, c, t, g;
	cin >> a >> b >> c >> t;
	if (a >= t) g = t * b;
	else g = (t - a) * c + a * b;
	cout << g;
}