728x90
문제
https://www.acmicpc.net/problem/11312
풀이
한 변의 길이가 A, B인 삼각형이 있을 때 ( B ≤ A) B로 A를 완전히 덮기 위해 필요한 수를 출력하면 된다.
이는 $(A / B)^2$이 된다.
while (T-- > 0) {
long[] info = Arrays.stream(br.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
final long a = info[0];
final long b = info[1];
// Solve
sb.append(a / b * a / b).append("\\n");
}
소스코드
728x90
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 11434] Ampelmännchen [Java] (1) | 2025.02.14 |
---|---|
[백준 11368] A Serious Reading Problem [Java] (0) | 2025.02.14 |
[백준 10406] The fellowship of the ring [Java] (0) | 2025.02.13 |
[백준 10865] 친구 친구 [Java] (1) | 2025.02.11 |
[백준 11006] 남욱이의 닭장 [Java] (0) | 2025.02.09 |