[swexpert] 11387. 몬스터사냥 (java)

728x90
반응형

 


import java.util.Scanner;

public class Solution {
	static int t;
	static int d,l,n;
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		t=sc.nextInt();
		for (int tc = 1; tc <=t; tc++) {
			int sum=0;
			d=sc.nextInt();
			l=sc.nextInt();
			n=sc.nextInt();
			for (int i = 0; i < n; i++) {
				sum+=d+d*i*l/100;
			}
			
			System.out.printf("#%d %d\n",tc,sum);
		}
	}
}
728x90
반응형
TAGS.

Comments