Under construction

Still being built. Things may change

Elevator

Time limit1sMemory limit1024 MB

Summary
Given the elevator's floor k, Misha's floor n, and the per-floor times a (stairs) and b (elevator), find the time to reach floor n by each method.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Misha lives on floor nn. When Misha enters the building, he checks which floor the elevator is on at that moment and decides whether to call the elevator or take the stairs.

Today the elevator is on floor kk. Misha enters the building on floor 1. Climbing one floor by the stairs takes aa seconds. The elevator moves one floor in bb seconds. Time spent entering or leaving the elevator, and time spent walking to the stairs or the elevator and back, can be ignored.

Help Misha decide by computing how long it takes him to reach his floor by elevator and by stairs.

Input

The input contains four integers nn, kk, aa, and bb.

2≤n≤1002 \le n \le 100, 1≤k≤1001 \le k \le 100, 1≤a,b≤10001 \le a, b \le 1000.

Output

Print two integers. The first is the time it takes Misha to reach his floor by elevator, and the second is the time it takes him to climb to his floor by stairs.

Hint

In the example, the elevator needs 7×3=217 \times 3 = 21 seconds to come down from floor 8, and then 14×3=4214 \times 3 = 42 seconds to go up to floor 15, where Misha lives. Misha needs 14×5=7014 \times 5 = 70 seconds to climb to floor 15 by the stairs.

Examples1

  1. Example 1

    Input
    15 8 5 3
    
    Expected output
    63 70