Under construction

Still being built. Things may change

Pizzas

Interview

Time limit1sMemory limit1024 MB

Summary
Given N riders, M showers, T minutes per shower, and a budget K, find the total pizza money left after each rider's shower-line wait is subtracted.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Organizing a cycling competition requires two things: showers and pizza.

Riders go straight to the showers when they finish, and buy pizza after showering. Sometimes there are not enough showers for everyone, so riders wait in line.

While waiting, riders eat snacks. If a rider originally planned to spend KK euros on pizza and waited ee minutes in the shower line, the rider spends K−eK - e euros on pizza. If the wait is too long and K−e≤0K - e \le 0, the rider buys no pizza.

The organizers set up MM showers. NN riders take part, and each rider spends TT minutes in a shower. Each rider originally plans to spend KK euros on snacks.

Calculate how many euros the organizers earn from selling pizza.

Input

The input is a single line with four integers NN, MM, TT, and KK, separated by spaces.

Output

Print one integer: the number of euros the organizers earn from selling pizza.

Constraints

  • 1≤N,M,T,K≤10000000001 \le N, M, T, K \le 1000000000
  • The answer for every test does not exceed 2000000000.

Examples1

  1. Example 1

    Input
    7 2 3 7
    
    Expected output
    24