Submission #854902


Source Code Expand

Copy
/* Filename: ABC044A.java
 * Author: Mushiyo
 */

import java.util.Scanner;

public class ABC044A {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);

		while (input.hasNext()) {
			int N = input.nextInt();
			int K = input.nextInt();
			int X = input.nextInt();
			int Y = input.nextInt();
			
			if(N <= K){
				System.out.println(N * X);
			} else {
				System.out.println(K * X + (N - K) * Y);
			}
		}
	}

}

Submission Info

Submission Time
Task A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
User Twilight
Language Java7 (OpenJDK 1.7.0)
Score 0
Code Size 474 Byte
Status

Compile Error

./Main.java:7: error: class ABC044A is public, should be declared in a file named ABC044A.java
public class ABC044A {
       ^
1 error