https://www.acmicpc.net/problem/10250
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int T = Integer.valueOf(br.readLine());
for(int i=0; i<T; i++){
String[] input = br.readLine().split(" ");
int count =1;
for(int j=0; j<Integer.valueOf(input[2]);j++){
count+=100;
if(count/100>Integer.valueOf(input[0])){
count-=(Integer.valueOf(input[0])*100);
count++;
}
}
bw.write(count+"\n");
}
bw.flush();
}
}
import java.util.Scanner;
class Main
{
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while (T-- > 0) {
int H = sc.nextInt();
int W = sc.nextInt();
int N = sc.nextInt();
int floor = ((N - 1) % H) + 1; // [1, H]
int number = (N - 1) / H + 1; // [1, W]
System.out.printf("%d%02d\n", floor, number);
}
}
}
'Problem Solving > 구현' 카테고리의 다른 글
BOJ2840 행운의 바퀴 (1) | 2024.01.31 |
---|---|
BOJ1730 판화 (R) (0) | 2024.01.31 |
BOJ3085 사탕 게임 (1) | 2024.01.30 |
BOJ11068 회문인수 (1) | 2024.01.30 |
BOJ11005 진법변환2 (0) | 2024.01.30 |