백준 #20233번 Bicycle

jhj·2024년 2월 13일

백준 JAVA

목록 보기
268/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int x = sc.nextInt();
		int b = sc.nextInt();
		int y = sc.nextInt();
		int t = sc.nextInt();
		int Atotal = 0, Btotal = 0;
		
		if(t <= 30) {
			Atotal = a;
		}else {
			Atotal = a + (t - 30) * x * 21;
		}
		
		if(t <= 45) {
			Btotal = b;
		}else {
			Btotal = b + (t - 45) * y * 21;
		}
		
		System.out.println(Atotal + " " + Btotal);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글