Submission #1988241


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		Console.WriteLine(X * Math.Min(K, N) + Y * Math.Max(0, N - K));
		
		
	}
	long N,K,X,Y;
	public Sol(){
		N = rl();
		K = rl();
		X = rl();
		Y = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}

Submission Info

Submission Time
Task A - Tak and Hotels (ABC Edit)
User kuuso
Language C# (Mono 4.6.2.0)
Score 100
Code Size 1046 Byte
Status AC
Exec Time 21 ms
Memory 11092 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 10
Set Name Test Cases
Sample example_01.txt, example_02.txt
All example_01.txt, example_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt
Case Name Status Exec Time Memory
example_01.txt AC 20 ms 9044 KB
example_02.txt AC 20 ms 9044 KB
subtask1_01.txt AC 20 ms 11092 KB
subtask1_02.txt AC 20 ms 9044 KB
subtask1_03.txt AC 20 ms 9044 KB
subtask1_04.txt AC 20 ms 11092 KB
subtask1_05.txt AC 20 ms 9044 KB
subtask1_06.txt AC 21 ms 11092 KB
subtask1_07.txt AC 20 ms 11092 KB
subtask1_08.txt AC 20 ms 9044 KB