for _ in range(30000):
    length = list(map(int, input().split()))
    length = sorted(length, reverse=True)

    if pow(length[0], 2) == 0 and length[1] == 0 and length[2] == 0:
        break

    if pow(length[0], 2) == pow(length[1], 2) + pow(length[2], 2):
        print ("right")
    else:
        print ("wrong")
import sys
import math
input = sys.stdin.readline
R = int(input())
print (round(math.pi * pow(R, 2), 6))
print (round(R * R * 2, 6))
#include <iostream>
using namespace std;

int solution1()
{
	int array[10] = {0, };
	int remainder[42] = {0,};
	int count = 0;
	
	for (int i=0; i<10; i++)
	{
		cin >> array[i];
		
		if (array[i] < 0 or array[i] > 1000)
			return 0;
		
		if (!remainder[array[i] % 42]++)	
			count = count + 1;
	}
	return count;
}



int main(void)
{
	int count = 0;
	count = solution1();
	cout << count << endl;
	
	return 0;
}
import sys
from collections import Counter
input = sys.stdin.readline

def get_square_coordinate(coordinates):
    X, Y = [], []
    for xy in coordinates:
        X.append(xy[0])
        Y.append(xy[1])

    cnt_x = Counter(X).most_common()
    cnt_y = Counter(Y).most_common()
    return cnt_x[-1][0], cnt_y[-1][0]
    
coordinates = []
for _ in range(3):
    coordinates.append(list(map(int, input().split())))

x, y = get_square_coordinate(coordinates)
print (x, y)
crotia = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z=']
word = input()

for i in crotia:
    word = word.replace(i, '*')

print (len(word))
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(void)
{
	string a, b;
	cin >> a >> b;
	if (a.size() == 3 and b.size() == 3)
	{
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		if (a > b)
			cout << a;
		else
			cout << b;
	}
	return 0;
}
#include <iostream>
#include <cstdlib>
using namespace std;

int main(void)
{
	int H = 0;
	int M = 0;
	int T = 45;
	
	cin >> H >> M;
	
	if ((H>=0 and H<=23) and (M>=0 and M<=59))
	{
		
		if (M-T >= 0) // M이 45분보다 커서 자릿수 내림이 발생하지 않을 때 
		{
			cout << H << " " << M-T << endl;
		}
		
		if((M-T < 0) and (H-1>=0))
		{
			cout << H-1 << " " << M-T+60 << endl;
		}
		
		else if((M-T < 0) and (H-1<0))
		{
			cout << H-1+24 << " " << M-T+60 << endl;
		}
		
	}
	
	return 0;
}
import sys
input = sys.stdin.readline
N, M, K = list(map(int, input().split()))
team = 0

# my fault
# intern = 0
# while True:
#     if N//2 >= M:
#         N = N-1
#         intern = intern + 1
#         if K == intern:
#             break
    
#     elif N//2 < M:
#         M = M -1
#         intern = intern + 1
#         if K == intern:
#             break

# t1 = N // 2
# t2 = M 
# print(min(t1, t2))

while True:
    N = N - 2
    M = M - 1
    if N < 0 or M < 0 or (N+M) < K:
        break
    team = team + 1
print (team)
A, B = map(str, input().split())
if "6" in A or "6" in B:
    A = A.replace("6","5")
    B = B.replace("6","5")
_min = sum(map(int, [A, B]))

if "5" in A or "5" in B:
    A = A.replace("5","6")
    B = B.replace("5","6")
_max = sum(map(int, [A, B]))
print (_min, _max)
#include <iostream>

#define BIG 5
#define SMALL 3

using namespace std;

int Solution(int N)
{
	int quoteB = N / BIG; // 큰 설탕의 upper bound를 우선 결정
	
	while(true)
	{
		
		int Remainder = N - (BIG * quoteB); // 큰 설탕의 개수에 따라 나머지 결정 
		if (Remainder % SMALL == 0)	// 나머지가 작은 설탕으로 딱 떨어질 경우, 큰 설탕 개수 + 작은 설탕 개수 반환 
		{
			int quoteS = Remainder / SMALL;
			return quoteB+quoteS;
		}
		
		if (quoteB == 0)
			break;
			
		quoteB = quoteB -1;
	}
	
	return -1;
	
}

int main(void)
{
	int N = 0;
	
	cin >> N;
	
	if (N>=3 and N<=5000)
	{
		int result = Solution(N);
		cout << result;
	}
	
	return 0;
}

+ Recent posts