백준 ACM 호텔 문제
www.acmicpc.net/problem/10250
풀이
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
String[] input = new String[n];
int i;
for (i = 0; i < n; i++) {
input[i] = br.readLine();
}
for (int j = 0; j < input.length; j++) {
String list[] = input[j].split(" ");
int height = Integer.parseInt(list[0]);
int num = Integer.parseInt(list[2]);
if (num % height == 0) {
System.out.println((height * 100) + (num / height));
} else {
System.out.println(((num % height) * 100) + ((num / height) + 1));
}
}
}
}
'알고리즘' 카테고리의 다른 글
[백준] JAVA 팰린드롬수 (1259) (0) | 2020.12.07 |
---|---|
[백준] JAVA 단어 정렬 (1181) - 리팩토링 필요 (0) | 2020.12.07 |
[백준] Java, C++ N-Queen (9663) (0) | 2020.12.07 |
[백준] JAVA 수찾기 (1920) (0) | 2020.12.07 |
[백준] JAVA - 괄호 (9012) (0) | 2020.12.07 |