숫자 N은 아래와 같다

이떄 a,b,c,d,e 구하는 문제 이다
#t로 시작하고, 공백을 한 칸 둔 다음 정답을 출력import java.util.*;
import java.io.*;
public class No_1945 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int i = 0; i < T; i++) {
int N = Integer.parseInt(br.readLine());
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
while (N % 2 == 0) {
a++;
N /= 2;
}
while (N % 3 == 0) {
b++;
N /= 3;
}
while (N % 5 == 0) {
c++;
N /= 5;
}
while (N % 7 == 0) {
d++;
N /= 7;
}
while (N % 11 == 0) {
e++;
N /= 11;
}
System.out.print("#" + (i + 1) + " " + a + " " + b + " " + c + " " + d + " " + e);
}
}
}
우선 문제를 보면 a,b,c,d,e를 구해야하니까 N들의 수는 2,3,5,7,11로 나눠떨어지는 수이다
따라서 N이 해당 숫자로 더 이상 나눠지지 않을 때까지 계속 나누는 것이다