s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s001556209 | p00106 | u078042885 | 1485451036 | Python | Python3 | py | Accepted | 20 | 7564 | 264 | a=[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]
dp=[1<<20]*51
for i,j in a:
dp[i]=j
for k in range(51-i):
if dp[k]!=1<<20 and dp[k+i]>dp[k]+j:
dp[k+i]=dp[k]+j
while 1:
n=int(input())
if n==0:break
print(dp[n//100]) | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,669 |
s072837367 | p00106 | u301729341 | 1499588471 | Python | Python3 | py | Accepted | 40 | 7664 | 552 | Soba = [[2,380],[3,550],[5,850],[10,1520],[12,1870],[15,2244]] #???,??????
while True:
g = int(input())
if g == 0:
break
g_g = int(g / 100)
DP = [[10000 for j in range(g_g + 1)] for i in range(7)]
for i in range(7):
DP[i][0] = 0
for i in range(7):
for j in range(g_g + 1):... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,670 |
s769405427 | p00106 | u811733736 | 1504485756 | Python | Python3 | py | Accepted | 40 | 7920 | 2,248 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0106&lang=jp
"""
import sys
def solve(amount):
"""
:param amount: ?????\???????????°?????????
:return: ?????????
"""
best_price = (amount + 199) // 200 * 380
for a in range(amount // 200 + 1):
for b in... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,671 |
s447083665 | p00106 | u198069342 | 1511357397 | Python | Python | py | Accepted | 10 | 6404 | 220 | h={15:2244,12:1870,10:1520,5:850,3:550,2:380}
m={0:0}
for i in range(50):
if i in m:
for k,v in h.items():
m[i+k] = min(m.get(i+k,1e9),m[i]+v)
while True:
n = input()
if n == 0 : break
print(m[n/100]) | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,672 |
s841010517 | p00106 | u742178809 | 1511767687 | Python | Python3 | py | Accepted | 30 | 7632 | 684 | import sys
#from me.io import dup_file_stdin
def price(pack,unit_price,units,off):
return pack//units*units*unit_price*(1.-off) + pack%units*unit_price
#@dup_file_stdin
def solve():
while True:
w = int(sys.stdin.readline())
if w == 0 :return
min = max([380*25,550*17,850*10])
fo... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,673 |
s743051847 | p00106 | u150984829 | 1517505931 | Python | Python3 | py | Accepted | 70 | 5596 | 326 | while True:
N = int(input())
if N==0: break
ans = float('inf')
for c200 in range(N//200+1):
for c300 in range(N//300+1):
for c500 in range(N//500+1):
if 200 * c200 + c300 * 300 + c500 * 500 == N:
ans = min(ans, 1520*(c200//5)+380*(c200%5)+1870*(c300//4)+550*(c300%4)+2244*(c500//3)+850*(c500%3))
print... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,674 |
s678066602 | p00106 | u150984829 | 1517516293 | Python | Python3 | py | Accepted | 20 | 5612 | 189 | a=[1e4]*51
for i,j in[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]:
a[i]=j
for k in range(51-i):
if a[k+i]>a[k]+j:a[k+i]=a[k]+j
for n in iter(input,'0'):print(a[int(n)//100])
| p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,675 |
s651128681 | p00106 | u150984829 | 1517517433 | Python | Python3 | py | Accepted | 20 | 5612 | 181 | a=[1e4]*51
for i,j in[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]:
a[i]=j
for k in range(51-i):a[k+i]=min(a[k]+j,a[k+i])
for n in iter(input,'0'):print(a[int(n)//100])
| p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,676 |
s057422520 | p00106 | u150984829 | 1517517621 | Python | Python3 | py | Accepted | 20 | 5608 | 181 | a=[1e4]*51
for i,j in[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]:
a[i]=j
for k in range(51-i):a[k+i]=min(a[k+i],a[k]+j)
for n in iter(input,'0'):print(a[int(n)//100])
| p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,677 |
s838093843 | p00106 | u043254318 | 1527475396 | Python | Python3 | py | Accepted | 20 | 5604 | 723 | def calc(A, B, C):
da = A // 5
na = A % 5
db = B // 4
nb = B % 4
dc = C // 3
nc = C % 3
return da*1520 + na*380 + db*1870 + nb*550 + dc*2244 + nc*850
def f(a, b, c, g):
if g == 0:
return calc(a, b, c)
if g < 0:
return 10000000
return min(f(a+1, b, c, g-2), f(a, ... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,678 |
s763130055 | p00106 | u352394527 | 1527699398 | Python | Python3 | py | Accepted | 30 | 5608 | 471 | INF = 10 ** 20
def solve(n):
ans = INF
for i in range(n // 500 + 1):
for j in range((n - 500 * i) // 300 + 1):
if not (n - 500 * i - 300 * j) % 200:
a = (n - 500 * i - 300 * j) // 200
va = a // 5 * 1900 * 0.8 + a % 5 * 380
vb = j // 4 * 2200 * 0.85 + j % 4 * 550
vc = i //... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,679 |
s531745033 | p00106 | u847467233 | 1529275043 | Python | Python3 | py | Accepted | 30 | 5596 | 454 | # AOJ 0106 Discounts of Buckwheat
# Python3 2018.6.18 bal4u
a = [ 2, 3, 5 ]
s = [ 380, 550, 850 ]
c = [ 10, 12, 15 ]
f = [ 1520, 1870, 2244 ]
tbl = [0]*60
def rec(i, v, cost):
if i == 3:
if (v <= 50 and tbl[v] == 0) or tbl[v] > cost: tbl[v] = cost
return
for j in range(0, 51-v, a[i]):
cc = j // c[i] * f[i] +... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,680 |
s608857772 | p00106 | u459861655 | 1350103768 | Python | Python | py | Accepted | 70 | 4508 | 695 | def ceil(n, m):
return n / m + 2 if n % m != 0 else n / m + 1
def gram(l):
return 200 * l[0] + 300 * l[1] + 500 * l[2]
def price(l):
def c(n, m, p, r):
d = (n / m) * m
return ((n - d) + d * r) * p
return int(c(l[0], 5, 380, 0.80) + c(l[1], 4, 550, 0.85) + c(l[2], 3, 850, 0.88))
t = []
for amount in ... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,681 |
s224157445 | p00106 | u665962315 | 1357527040 | Python | Python | py | Accepted | 70 | 4288 | 877 | def price(num_unit, shop):
A, B, C = 0, 1, 2
if shop == A:
num_discount = (num_unit / 5) * 5
return 380 * num_discount * 0.8 + 380 * (num_unit % 5)
elif shop == B:
num_discount = (num_unit / 4) * 4
return 550 * num_discount * 0.85 + 550 * (num_unit % 4)
else:
... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,682 |
s213161551 | p00106 | u647766105 | 1358992453 | Python | Python | py | Accepted | 20 | 4272 | 264 | w=[200,300,500,1000,1200,1500]
p=[380,550,850,1520,1870,2244]
dp=[2<<20]*5001
dp[0]=0
for i in xrange(6):
for j in xrange(0,5000-w[i]+1,100):
dp[j+w[i]] = min(dp[j+w[i]] , dp[j]+p[i])
while True:
n=input()
if n==0:
break
print dp[n] | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,683 |
s541939206 | p00106 | u577457452 | 1361633448 | Python | Python | py | Accepted | 30 | 4260 | 527 | while 1:
w = int(raw_input())
if w == 0: break
minp = 9500
for c in range(11):
for b in range(17):
for a in range(26):
t = 200 * a + 300 * b + 500 * c
if t > w: break
if t == w:
p = int(380 * (a - a % 5) * 0.8 + 380 ... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,684 |
s116600189 | p00106 | u542421762 | 1370621391 | Python | Python | py | Accepted | 30 | 4316 | 742 |
import sys
class Item:
def __init__(self, amount, price):
self.amount = amount
self.price = price
items = [ Item(200, 380), # 380
Item(300, 550), # 550
Item(500, 850), # 850
Item(200 * 5, 380 * 5 * 0.8), ... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,685 |
s448779663 | p00106 | u782850731 | 1382528796 | Python | Python | py | Accepted | 10 | 4240 | 667 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
def main(readline=stdin.readline):
price_table = (
0, 0, 380, 550, 760, 850, 1100, 1230, 1400, 1610, 1520, 1950,
1870, 2070, 2250, 2244, 2620, 2624, 2794, 3004, 3040, 3344,
3390, 3590, 3740, 3... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,686 |
s732347284 | p00106 | u633068244 | 1398331140 | Python | Python | py | Accepted | 20 | 4236 | 273 | r = 51
wc = [[15,2244],[10,1520],[12,1870],[5,850],[3,550],[2,380]]
dp = [0]*r
for w,c in wc:
dp[w] = c
for i in range(r - w):
if dp[i] > 0 and (dp[i + w] == 0 or dp[i + w] > dp[i] + c):
dp[i + w] = dp[i] + c
while 1:
n = input()
if n == 0: break
print dp[n/100] | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,687 |
s651241299 | p00106 | u633068244 | 1398331665 | Python | Python | py | Accepted | 10 | 4240 | 261 | r,x = 51,2**31
wc = [[15,2244],[10,1520],[12,1870],[5,850],[3,550],[2,380]]
dp = [x]*r
for w,c in wc:
dp[w] = c
for i in range(r - w):
if dp[i] < x and dp[i + w] > dp[i] + c:
dp[i + w] = dp[i] + c
while 1:
n = input()
if n == 0: break
print dp[n/100] | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,688 |
s599144401 | p00106 | u770042163 | 1597237060 | Python | Python3 | py | Accepted | 20 | 5604 | 538 | """
A店:200g,380y,20%/5 → 1.9y/g
B店:300g,550y,15%/4 → 1.83y/g
C店:500g,850y,12%/3 → 1.7y/g
380*5 *0.8 = 1520 304/1つ
550*4 *0.85 = 1870 467.5/1つ
850*3 *0.88 = 2244 748/1つ
"""
# 購入数は50g刻みと明言されているので
P = [2,10, 3,12, 5,15]
Q = [380,1520, 550,1870, 850,2244]
MAX = 50
Range = [0] + [1000000]*MAX
for p,q in zip(P,Q):
... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,689 |
s593194101 | p00106 | u630911389 | 1589182990 | Python | Python3 | py | Accepted | 20 | 5596 | 301 | P = [2, 10, 3, 12, 5, 15]
Q = [380, 1520, 550, 1870, 850, 2244]
MAX = 50
Range = [0] + [1000000] * MAX
for p, q in zip(P, Q):
for i in range(MAX - p + 1):
Range[i + p] = min(Range[i + p],Range[i] + q)
while 1:
v = int(input())
if v == 0:
break
print(Range[v // 100])
| p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,690 |
s814782651 | p00106 | u260980560 | 1588638309 | Python | Python3 | py | Accepted | 20 | 5612 | 259 | P = [2, 10, 3, 12, 5, 15]
Q = [380, 1520, 550, 1870, 850, 2244]
L = 50
R = [0] + [1e9]*L
for p, q in zip(P, Q):
for i in range(L-p+1):
R[i+p] = min(R[i+p], R[i] + q)
while 1:
v = int(input())
if v == 0:
break
print(R[v//100])
| p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,691 |
s316656973 | p00106 | u314166831 | 1563992043 | Python | Python3 | py | Accepted | 40 | 5688 | 3,321 | # coding=utf-8
###
### for python program
###
import sys
import math
# math class
class mymath:
### pi
pi = 3.14159265358979323846264338
### Prime Number
def pnum_eratosthenes(self, n):
ptable = [0 for i in range(n+1)]
plist = []
for i in range(2, n+1):
if ptable... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,692 |
s549823407 | p00106 | u024715419 | 1542261572 | Python | Python3 | py | Accepted | 50 | 5588 | 347 | while True:
g = int(input())//100
if g == 0:
break
p = 100000
for a in range(g//2 + 1):
for b in range(g//3 + 1):
for c in range(g//5 + 1):
if a*2 + b*3 + c*5 == g:
p = min(p, 1520*(a//5) + 380*(a%5) + 1870*(b//4) + 550*(b%4) + 2244*(c//3) ... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,693 |
s592296991 | p00106 | u316584871 | 1537960538 | Python | Python3 | py | Accepted | 30 | 5612 | 517 | INF = 10**20
def solve(n):
inf = INF
for i in range((n//500) + 1):
for j in range(((n - 500*i)//300) + 1):
if ((n - 500*i - 300*j)%200 == 0):
a = (n - 500*i - 300*j)//200
va = (a//5)*380*5*0.8 + (a%5)*380
vj = (j//4)*550*4*0.85 + (j%4)*550
... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,694 |
s259699885 | p00106 | u319725914 | 1533971679 | Python | Python3 | py | Accepted | 80 | 5628 | 586 | p1,p2,p3 = 380,550,850
q1,q2,q3 = 200,300,500
d1,d2,d3 = 5,4,3
r1,r2,r3 = 0.2,0.15,0.12
arr = []
for tot in range(500,5001,100):
lst = 1000000000
for i in range(0,int(tot/q1)+1):
for j in range(0,int(tot/q2)+1):
for k in range(0,int(tot/q3)+1):
if i*q1+j*q2+k*q3 == tot:
... | p00106 |
<H1>Discounts of Buckwheat</H1>
<p>
Aizu is famous for its buckwheat. There are many people who make buckwheat noodles by themselves.
</p>
<p>
One day, you went shopping to buy buckwheat flour. You can visit three shops, A, B and C. The amount in a bag and its unit price for each shop is determined by the follows ... | 500
2200
0
| 850
3390
| 13,695 |
s336482446 | p00107 | u899060994 | 1409730810 | Python | Python | py | Accepted | 10 | 4204 | 323 | while True:
size = map(int,raw_input().split())
if size[0] == size[1] == size[2] == 0:
break
size = sorted(size)
rmin2 = size[0]**2 + size[1]**2
n = input()
for i in range(n):
R2 = 4 * input()**2
if rmin2 < R2:
print 'OK'
else:
print '... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,696 |
s616547119 | p00107 | u899060994 | 1409731017 | Python | Python | py | Accepted | 10 | 4204 | 301 | while True:
size = map(int,raw_input().split())
if size[0] == 0:
break
size = sorted(size)
rmin2 = size[0]**2 + size[1]**2
n = input()
for i in range(n):
R2 = (input()**2)*4
if rmin2 < R2:
print 'OK'
else:
print 'NA' | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,697 |
s935888185 | p00107 | u912237403 | 1414667193 | Python | Python | py | Accepted | 20 | 4260 | 149 | while 1:
a,b,c=sorted(map(int,raw_input().split()))
if a==b==c==0: break
D=(a*a+b*b)**.5
for _ in [0]*input(): print ["NA","OK"][2*input()>D] | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,698 |
s802002040 | p00107 | u912237403 | 1414667355 | Python | Python | py | Accepted | 10 | 4208 | 164 | while 1:
a,b,c=sorted(map(int,raw_input().split()))
if a==b==c==0: break
D=a*a+b*b
n=input()
for _ in [0]*n:
r=input()
print ["NA","OK"][4*r**2>D] | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,699 |
s312980396 | p00107 | u879226672 | 1424846384 | Python | Python | py | Accepted | 10 | 4216 | 360 | def hantei(A,B,C,R=0):
p,q = sorted([A,B,C])[:2]
if p**2 + q**2 < 4 * R**2:
print 'OK'
else:
print 'NA'
while True:
try:
A,B,C = map(int,raw_input().split())
if (A,B,C) == (0,0,0):
break
except EOFError:
break
for k in range(int(raw_input()))... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,700 |
s090089480 | p00107 | u266872031 | 1428057042 | Python | Python | py | Accepted | 10 | 4212 | 323 | while(1):
size=sorted([int(x) for x in raw_input().split()])
if size[0]==0:
break
else:
cr=size[0]**2+size[1]**2
n=int(raw_input())
for i in range(n):
r=int(raw_input())
if 4*r**2>cr:
print 'OK'
else:
print '... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,701 |
s282388575 | p00107 | u162387221 | 1431529601 | Python | Python | py | Accepted | 20 | 4200 | 270 | while True:
solid = sorted(map(int, raw_input().split()))
if solid.count(0) == 3: break
n = input()
s = (solid[0]**2+solid[1]**2)/4
for i in range(n):
r = input()
if r*r > s:
print 'OK'
else:
print 'NA' | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,702 |
s543079612 | p00107 | u379499530 | 1432199187 | Python | Python | py | Accepted | 10 | 4292 | 263 | while True:
A, B, C = map(int, raw_input().split())
if A == 0: break;
n = input()
r = min([((A**2)+(B**2))**0.5, ((A**2)+(C**2))**0.5, ((B**2)+(C**2))**0.5])
for i in range(n):
if (input()*2 > r): print "OK"
else: print "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,703 |
s431730794 | p00107 | u873482706 | 1435215684 | Python | Python | py | Accepted | 10 | 4380 | 518 | import math
def Tom_and_Jerry():
for i in range(int(raw_input())):
r = int(raw_input())
if r > t:
print 'OK'
else:
print 'NA'
while True:
h, w, d = map(int, raw_input().split(' '))
if h == 0: break
a = math.sqrt(h**2 + w**2) / 2.0
b = math.sqrt(... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,704 |
s054398729 | p00107 | u489809100 | 1447433042 | Python | Python | py | Accepted | 10 | 6332 | 282 | import math
def doc_string():
"""
I can fly.
"""
while True:
tz = map(int,raw_input().split())
if tz == [0,0,0]:
break
til = math.hypot(*sorted(tz)[:2]) / 2
for i in xrange(int(raw_input())):
gate = int(raw_input())
if gate > til:
print "OK"
else:
print "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,705 |
s184955448 | p00107 | u775586391 | 1451545156 | Python | Python3 | py | Accepted | 20 | 7684 | 247 | while True:
l = [int(i) for i in input().split()]
if l == [0,0,0]:
break
l.sort()
r = (l[0]**2+l[1]**2)**(1/2)/2
n = int(input())
for i in range(n):
r1 = int(input())
if r < r1:
print('OK')
else:
print('NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,706 |
s429201574 | p00107 | u140201022 | 1464273331 | Python | Python | py | Accepted | 0 | 6436 | 282 | def sol():
tmp=min([x**2+y**2,x**2+z**2,y**2+z**2])
n=int(raw_input())
for i in range(n):
r=int(raw_input())
print 'OK' if (r**2)*4>tmp else 'NA'
while 1:
x,y,z=map(int,raw_input().split())
if min(x,y,z)==0:
break
else:
sol() | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,707 |
s893273569 | p00107 | u589886885 | 1472214209 | Python | Python3 | py | Accepted | 20 | 7696 | 396 | import math
while True:
d, w, h = [int(x) for x in input().split()]
if d == w == h == 0:
break
dw = math.sqrt(d * d + w * w)
dh = math.sqrt(d * d + h * h)
wh = math.sqrt(w * w + h * h)
min_ = min(dw, dh, wh)
n = int(input())
for i in range(n):
r = int(input()) * 2
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,708 |
s878189361 | p00107 | u350804311 | 1473279181 | Python | Python3 | py | Accepted | 30 | 7548 | 474 | while True:
try:
d, w, h = list(map(int, input().split()))
if d == w == h == 0:
break
n = int(input())
r = []
for i in range(n):
r = int(input())
if r ** 2 > (d ** 2 + w ** 2) / 4 \
or r ** 2 > (d ** 2 + h ** 2) / 4 \
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,709 |
s848399151 | p00107 | u500396695 | 1478190773 | Python | Python3 | py | Accepted | 20 | 7668 | 262 | import math
while True:
l1, l2, l3 = sorted(list(int(i) for i in input().split()))
if l1 == l2 == l3 == 0:
break
n = int(input())
R = math.sqrt(l1 ** 2 + l2 ** 2) / 2
for i in range(n):
r = int(input())
if r > R:
print('OK')
else:
print('NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,710 |
s752481297 | p00107 | u301729341 | 1481864420 | Python | Python3 | py | Accepted | 20 | 7660 | 359 | while True:
Size_lis = list(map(int,input().split()))
if Size_lis == [0,0,0]:
break
n = int(input())
Size_lis.remove(max(Size_lis))
m_r = (Size_lis[0] / 2) ** 2 + (Size_lis[1] / 2) ** 2
for i in range(n):
r = int(input())
if m_r >= r ** 2:
print("NA")
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,711 |
s458942918 | p00107 | u078042885 | 1484588482 | Python | Python3 | py | Accepted | 30 | 7600 | 167 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
c=(a**2+b**2)**0.5
for _ in range(int(input())):print('OK' if c<int(input())*2 else 'NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,712 |
s153893558 | p00107 | u078042885 | 1484588642 | Python | Python3 | py | Accepted | 30 | 7520 | 168 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
c=(a**2+b**2)**0.5//2
for _ in range(int(input())):print('OK' if c<int(input()) else 'NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,713 |
s399387231 | p00107 | u919202930 | 1488436794 | Python | Python3 | py | Accepted | 20 | 7748 | 458 | def min_diam(A,B,C): # returns a "diameter"
segments=[A,B,C]
segments.sort()
return (segments[0]**2+segments[1]**2)**(1/2)
while True:
# input one dataset
A,B,C = tuple(map(float,input().split()))
if (A,B,C) == (0,0,0):
break
n = int(input())
R = [None]*n
for i in range(n):
R[i] = float(input... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,714 |
s586248523 | p00107 | u462831976 | 1494244230 | Python | Python3 | py | Accepted | 30 | 7640 | 401 | # -*- coding: utf-8 -*-
import sys
import os
import math
for s in sys.stdin:
d, w, h = map(int, s.split())
if d == w == h == 0:
break
lst = [d, w, h]
lst.sort()
diameter = math.sqrt(lst[0] ** 2 + lst[1] ** 2)
n = int(input())
for i in range(n):
r = int(input())
i... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,715 |
s615292317 | p00107 | u321712183 | 1494245529 | Python | Python3 | py | Accepted | 30 | 7696 | 406 | # -*- coding: utf-8 -*-
import sys
import os
import math
for s in sys.stdin:
d, w, h = map(int, s.split())
if d == w == h == 0:
break
lst = [d, w, h]
lst.sort()
diameter = math.sqrt(lst[0] ** 2 + lst[1] ** 2)
n = int(input())
for i in range(n):
r = int(input())
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,716 |
s403922030 | p00107 | u546285759 | 1497347439 | Python | Python3 | py | Accepted | 20 | 7584 | 252 | while True:
d, w, h = map(int, input().split())
if d == 0:
break
n = int(input())
a, b = sorted([d, w, h])[:2]
t = pow(pow(a, 2) + pow(b, 2), 0.5) // 2
for _ in range(n):
print("OK" if int(input()) > t else "NA") | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,717 |
s156985210 | p00107 | u811733736 | 1504487778 | Python | Python3 | py | Accepted | 30 | 7732 | 953 | # -*- coding: utf-8 -*-
"""
"""
import sys
def solve(d, w, h, holes):
result = []
diagonal_len = (w**2 + h**2)**0.5
for r in holes:
if r*2 > diagonal_len:
result.append('OK')
else:
result.append('NA')
# ???????????\????????£?????¢???1????????????: ????????????r ... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,718 |
s625892452 | p00107 | u957021183 | 1505295042 | Python | Python3 | py | Accepted | 20 | 7752 | 432 | # Aizu Problem 0107: Carry a Cheese
#
import sys, math, os
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
while True:
a, b, c = sorted([int(_) for _ in input().split()])
R = .5 * math.sqrt(a**2 + b**2)
if a == b == c == 0:
break
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,719 |
s461407448 | p00107 | u960312159 | 1508978665 | Python | Python3 | py | Accepted | 50 | 7632 | 293 | while True:
d, w, h = [int(x) for x in input().split()]
minrad = min(d*d+w*w,w*w+h*h,h*h+d*d)
if minrad == 0:
break
n = int(input())
for i in range(n):
r = int(input())
if 4*r*r > minrad:
print('OK')
else:
print('NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,720 |
s793509210 | p00107 | u742505495 | 1510819598 | Python | Python3 | py | Accepted | 30 | 7760 | 276 | import math
while True:
d,w,h = map(int,input().split())
if d == 0:
break
n = int(input())
dist = [math.sqrt(d**2+w**2), math.sqrt(d**2+h**2), math.sqrt(w**2+h**2)]
leng = min(dist)
for i in range(n):
if 2*int(input())-leng > 0:
print('OK')
else:
print('NA') | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,721 |
s534763187 | p00107 | u742178809 | 1511768994 | Python | Python3 | py | Accepted | 20 | 7784 | 429 | import sys
#from me.io import dup_file_stdin
#@dup_file_stdin
def solve():
while True:
l = list(map(int,sys.stdin.readline().split(' ')))
if l[0] == 0: break
l.sort();
n = int(sys.stdin.readline())
for i in range(n):
r = int(sys.stdin.readline())
if r... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,722 |
s198849908 | p00107 | u808429775 | 1516446066 | Python | Python3 | py | Accepted | 20 | 5672 | 488 | import math
output = []
while True:
depth, width, height = [int(item) for item in input().split(" ")]
if depth == 0 and width == 0 and height == 0:
break
cheeseRadius = math.sqrt((width / 2)**2 + (height / 2)**2)
inputCount = int(input())
for lp in range(inputCount):
entranceRa... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,723 |
s805917001 | p00107 | u150984829 | 1517519783 | Python | Python3 | py | Accepted | 20 | 5592 | 147 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
for _ in[0]*int(input()):
r=int(input())
print("OK"if r*r*4>a*a+b*b else"NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,724 |
s597199468 | p00107 | u150984829 | 1517519832 | Python | Python3 | py | Accepted | 30 | 5600 | 141 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
for _ in[0]*int(input()):print("OK"if (int(input())*2)**2>a*a+b*b else"NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,725 |
s228500884 | p00107 | u150984829 | 1517519839 | Python | Python3 | py | Accepted | 20 | 5604 | 141 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
for _ in[0]*int(input()):print("OK"if (int(input())*2)**2>a*a+b*b else"NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,726 |
s016065025 | p00107 | u150984829 | 1517519933 | Python | Python3 | py | Accepted | 20 | 5604 | 140 | while 1:
a,b,_=sorted(map(int,input().split()))
if a==0:break
for _ in[0]*int(input()):print("OK"if(int(input())*2)**2>a*a+b*b else"NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,727 |
s671539861 | p00107 | u043254318 | 1522163085 | Python | Python3 | py | Accepted | 20 | 5600 | 452 | def get_input():
while True:
try:
yield ''.join(input())
except EOFError:
break
while True:
d = [int(i) for i in input().split()]
if d[0] == 0 and d[1] == 0 and d[2] == 0:
break
d.sort()
cheese = d[0] * d[0] + d[1] * d[1]
N = int(input())
fo... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,728 |
s879015264 | p00107 | u352394527 | 1527699825 | Python | Python3 | py | Accepted | 20 | 5616 | 237 | while True:
lst = list(map(int, input().split()))
if not lst[0]:
break
lst.sort()
rad = (lst[0] ** 2 + lst[1] ** 2 ) ** (1 / 2) / 2
n = int(input())
for _ in range(n):
print("OK" if int(input()) > rad else "NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,729 |
s099859312 | p00107 | u136916346 | 1528553982 | Python | Python3 | py | Accepted | 20 | 5644 | 357 | import itertools
def ch(l,r):
t=itertools.combinations(l,2)
for i in t:
if i[0]**2+i[1]**2<4*r**2:
return True
return False
while 1:
l=list(map(int,input().split()))
if l[0]==0 and l[1]==0 and l[2]==0:break
o=[ch(l,int(input())) for i in range(int(input()))]
[print("OK... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,730 |
s702890518 | p00107 | u847467233 | 1529193535 | Python | Python3 | py | Accepted | 20 | 5592 | 281 | # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u
while True:
d, w, h = list(map(int, input().split()))
if d == 0 and w == 0 and h == 0: break
vmin = min(d*d+w*w, d*d+h*h, w*w+h*h)
for _ in range(int(input())):
r = int(input())
print('OK' if (2*r)**2 > vmin else 'NA')
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,731 |
s486418206 | p00107 | u459861655 | 1353430153 | Python | Python | py | Accepted | 10 | 5648 | 455 | import math
results = []
while True:
line = raw_input()
if line == '0 0 0':
for r in results:
print r
break
else:
t = [int(n) for n in line.split()]
t.sort()
size = math.sqrt(t[0] * t[0] + t[1] * t[1])
entry = input()
for i in range(entry)... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,732 |
s810642944 | p00107 | u459861655 | 1353430153 | Python | Python | py | Accepted | 10 | 5648 | 455 | import math
results = []
while True:
line = raw_input()
if line == '0 0 0':
for r in results:
print r
break
else:
t = [int(n) for n in line.split()]
t.sort()
size = math.sqrt(t[0] * t[0] + t[1] * t[1])
entry = input()
for i in range(entry)... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,733 |
s554997551 | p00107 | u665962315 | 1357529706 | Python | Python | py | Accepted | 10 | 4372 | 382 | from math import sqrt
while True:
a, b, c = map(int, raw_input().split())
if a == 0 and b == 0 and c == 0:
break
d1, d2, d3 = sqrt(a**2 + b**2), sqrt(b**2 + c**2), sqrt(c**2 + a**2)
for i in range(int(raw_input())):
r = int(raw_input())
if d1 < r * 2 or d2 < r * 2 or d3 < r * ... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,734 |
s085909181 | p00107 | u647766105 | 1359017630 | Python | Python | py | Accepted | 10 | 4300 | 260 | while True:
le=map(float,raw_input().split())
if le==[0,0,0]:
break
mdl=min([(le[i-1]**2+le[i]**2)**0.5 for i in xrange(3)])
for u in xrange(input()):
if input()*2>mdl:
print "OK"
else:
print "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,735 |
s114922427 | p00107 | u577457452 | 1361685252 | Python | Python | py | Accepted | 10 | 4368 | 220 | import math
while 1:
es = map(int, raw_input().split())
if es == [0, 0, 0]: break
r = math.hypot(*sorted(es)[:2]) / 2
for i in range(int(raw_input())):
print 'OK' if int(raw_input()) > r else 'NA' | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,736 |
s868977668 | p00107 | u104911888 | 1366605577 | Python | Python | py | Accepted | 20 | 4380 | 273 | import math
while True:
l,w,h=map(int,raw_input().split())
if l==w==h==0:
break
n=input()
for i in range(n):
r=input()
leng=math.sqrt(pow(w,2)+pow(h,2))/2
if r>leng:
print "OK"
else:
print "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,737 |
s981644406 | p00107 | u542421762 | 1370667964 | Python | Python | py | Accepted | 10 | 4396 | 589 |
import sys
import math
def solv(l, w, h, ent):
cheese = [l, w, h]
cheese.pop(cheese.index(max(cheese)))
diagonal = math.sqrt(cheese[0] ** 2 + cheese[1] ** 2)
ent_size = map(lambda x: x * 2, ent)
for size in ent_size:
if diagonal < size:
print 'OK'
else:
pri... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,738 |
s303386342 | p00107 | u180584272 | 1381706268 | Python | Python | py | Accepted | 20 | 4352 | 298 | from math import sqrt
while True:
inp = raw_input()
if inp == "0 0 0": break
cs = map(int,inp.split())
cs.sort()
c = sqrt(cs[0]**2 + cs[1]**2)/2
n=int(raw_input())
for gomi in xrange(n):
r = int(raw_input())
if c<r: print "OK"
else: print "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,739 |
s864386778 | p00107 | u782850731 | 1382536110 | Python | Python | py | Accepted | 10 | 4396 | 602 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from math import hypot
def main(readline=stdin.readline):
answer = ('NA', 'OK')
while 1:
height, width, depth = (float(s) for s in readline().split())
if not height:
exit()
h... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,740 |
s263779534 | p00107 | u260980560 | 1385144727 | Python | Python | py | Accepted | 20 | 4224 | 218 | while 1:
s=map(int, raw_input().split())
s.sort()
if s==[0,0,0]: break
n = input()
cr = float(s[0]**2+s[1]**2)/4.0
for i in xrange(n):
r = input()
print "OK" if cr<r**2 else "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,741 |
s571617313 | p00107 | u260980560 | 1385144938 | Python | Python | py | Accepted | 20 | 4208 | 209 | while 1:
s=map(int, raw_input().split())
s.sort()
if s==[0,0,0]: break
n = input()
cr = s[0]**2+s[1]**2
for i in xrange(n):
r = input()
print "OK" if cr<4*r**2 else "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,742 |
s885282051 | p00107 | u223011712 | 1393118091 | Python | Python | py | Accepted | 10 | 4380 | 592 | import sys
import math
def solv(l, w, h, ent):
cheese = [l, w, h]
cheese.pop(cheese.index(max(cheese)))
diagonal = math.sqrt(cheese[0] ** 2 + cheese[1] ** 2)
ent_size = map(lambda x: x * 2, ent)
for size in ent_size:
if diagonal < size:
print 'OK'
else:
pr... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,743 |
s167072046 | p00107 | u633068244 | 1394015954 | Python | Python | py | Accepted | 10 | 4356 | 341 | import math
while True:
w,l,h = map(int, raw_input().split())
if w == 0:
break
d = [math.sqrt(w**2+l**2), math.sqrt(l**2+h**2), math.sqrt(h**2+w**2)]
m = min(d)
n = int(raw_input())
for i in range(n):
r = int(raw_input())
if 2*r > m:
print "OK"
else:
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,744 |
s204210912 | p00107 | u193025715 | 1399864516 | Python | Python | py | Accepted | 20 | 4272 | 213 | while True:
size = map(int, raw_input().split())
if sum(size) == 0: break
size.remove(max(size))
m = (size[0]**2 + size[1]**2) ** 0.5
for i in range(input()):
n = input()
print "OK" if m < n * 2 else "NA" | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,745 |
s506945216 | p00107 | u770042163 | 1597304624 | Python | Python3 | py | Accepted | 20 | 5620 | 470 | # 長方体の内小さい2辺を元に長方形の外接円を考える
# sqrt(a^2+b^2)/2が長方形の外接円の半径となるため
# r>sqrt(a^2+b^2)/2であれば入口に接さずにチーズを搬入可能
while 1:
dwh = list(map(int,input().split()))
if dwh[0]==dwh[1]==dwh[2]==0:
break
dwh.sort()
cir = ((dwh[0]**2 + dwh[1]**2)**(1/2))/2
n = int(input())
for i in range(n):
print("OK"... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,746 |
s549058791 | p00107 | u240091169 | 1590892319 | Python | Python3 | py | Accepted | 20 | 5660 | 419 | import math
while True :
d, w, h = map(int, input().split())
if d == 0 and w == 0 and h == 0 :
break
length = [d, w, h]
len_1 = sorted([d, w, h])[0]
len_2 = sorted([d, w, h])[1]
max_d = math.sqrt(len_1**2 + len_2**2)
n = int(input())
for i in range(n) :
r = int(... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,747 |
s265442421 | p00107 | u630911389 | 1584576647 | Python | Python3 | py | Accepted | 30 | 5600 | 295 | while True:
d, w, h = (int(x) for x in input().split())
if d == 0: break
q = int(input())
vmin = min(d * d + w * w, d * d + h * h, w * w + h * h)
for i in range(0,q):
r = int(input())
ans = 'NA'
if (2 * r) ** 2 > vmin:
ans = 'OK'
print(ans)
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,748 |
s190983439 | p00107 | u313600138 | 1564806674 | Python | Python3 | py | Accepted | 20 | 5592 | 256 | while True:
d, w,h =list(map(int, input().split()))
if d ==0 and w==0 and h==0:
break
m = min(d*d+w*w, d*d+h*h, w*w+h*h)
for i in range(int(input())):
r = int(input())
if (2*r)**2 >m:
print("OK")
else:
print("NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,749 |
s077255656 | p00107 | u314166831 | 1563993658 | Python | Python3 | py | Accepted | 20 | 5728 | 3,144 | # coding=utf-8
###
### for python program
###
import sys
import math
# math class
class mymath:
### pi
pi = 3.14159265358979323846264338
### Prime Number
def pnum_eratosthenes(self, n):
ptable = [0 for i in range(n+1)]
plist = []
for i in range(2, n+1):
if ptable... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,750 |
s897098276 | p00107 | u051789695 | 1562770267 | Python | Python3 | py | Accepted | 20 | 5588 | 257 | while True:
a=sorted(list(map(int,input().split())))
if sum(a)==0:
break
s=min(a[0]**2+a[1]**2,a[1]**2+a[2]**2,a[0]**2+a[2]**2)
n=int(input())
for i in range(n):
r=int(input())
print("OK" if (r*2)**2>s else "NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,751 |
s171674386 | p00107 | u548252256 | 1562253526 | Python | Python3 | py | Accepted | 20 | 5660 | 479 | import math
if __name__ == '__main__':
while True:
d,w,h = map(int,input().split())
if d == 0 and w == 0 and h == 0:
break
a1 = math.sqrt(d*d + h*h)
a2 = math.sqrt(d*d + w*w)
a3 = math.sqrt(h*h + w*w)
n = int(input())
for _ in range(n):... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,752 |
s038507159 | p00107 | u647694976 | 1561435955 | Python | Python3 | py | Accepted | 20 | 5636 | 265 | while 1:
cheese=list(map(int,input().split()))
if cheese[0]==0:break
n=int(input())
cheese=sorted(cheese)
for i in range(n):
radius = int(input())
if radius*2>(cheese[0]**2+cheese[1]**2)**0.5:print("OK")
else:print("NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,753 |
s739374771 | p00107 | u990228206 | 1551765311 | Python | Python3 | py | Accepted | 20 | 5632 | 320 | while 1:
try:
dwh=list(map(int,input().split()))
if dwh[0]==dwh[1]==dwh[2]==0:break
dwh.sort()
std=(dwh[0]**2+dwh[1]**2)**0.5/2
n=int(input())
for i in range(n):
r=int(input())
if std<r:print("OK")
else:print("NA")
except:break
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,754 |
s448657154 | p00107 | u717526540 | 1543278249 | Python | Python3 | py | Accepted | 20 | 5668 | 422 | import math
while 1:
d, w, h = map(int, input().split())
if d == 0:
break
datas = []
n = int(input())
for _ in range(n):
r = int(input())
datas.append(r)
cheese = [d, w, h]
cheese.sort()
a = cheese[0]
b = cheese[1]
r = math.sqrt(a**2 + b**2) / 2
fo... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,755 |
s779985235 | p00107 | u024715419 | 1542262923 | Python | Python3 | py | Accepted | 20 | 5596 | 293 | while True:
d, w, h = map(int, input().split())
if d == 0:
break
d = min(d**2 + w**2, w**2 + h**2, h**2 + d**2)
n = int(input())
for i in range(n):
d_i = (int(input())*2)**2
if d_i > d:
print("OK")
else:
print("NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,756 |
s459415167 | p00107 | u525366883 | 1538266400 | Python | Python3 | py | Accepted | 20 | 5592 | 280 | while True:
d, w, h = sorted(map(int, input().split()))
if d == w == h == 0:
break
dw = (d**2 + w**2)
n = int(input())
for i in range(n):
y = int(input())
if (2*y)**2 > dw:
print("OK")
else:
print("NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,757 |
s276835165 | p00107 | u316584871 | 1537961268 | Python | Python3 | py | Accepted | 20 | 5596 | 316 | while True:
ch = list(map(int,input().split()))
if (0 in ch):
break
ch.sort()
n = int(input())
a = ch[0]
b = ch[1]
d = a**2 + b**2
for i in range(n):
r = int(input())
R = 2*r
if (R**2 > d):
print('OK')
else:
print('NA')
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,758 |
s669590392 | p00107 | u103916545 | 1536074367 | Python | Python3 | py | Accepted | 20 | 5604 | 498 | t = []
temp = 0
while True:
d,w,h = [int(s) for s in input().split(' ')]
if d < w:
temp = d
else:
temp = w
if d == 0 and w == 0 and h == 0:
break
else:
n = int(input())
for i in range(n):
t.append(i)
... | p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,759 |
s181523371 | p00107 | u319725914 | 1533973115 | Python | Python3 | py | Accepted | 20 | 5592 | 292 | while(True):
d,w,h = map(int, input().split())
if d == 0 and w == 0 and h == 0:
break
l = min(d*d+w*w,w*w+h*h,h*h+d*d)
n = int(input())
for i in range(n):
r = int(input())
if 4*r*r > l:
print("OK")
else:
print("NA")
| p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
| 13,760 |
s576030848 | p00108 | u371539389 | 1559554283 | Python | Python3 | py | Accepted | 30 | 5612 | 514 | import sys
def _nextstep(s):
retval=[0 for i in range(len(s))]
for i,si in enumerate(s):
retval[i]=s.count(si)
return retval
def fudouten(s):
count=0
while True:
next=_nextstep(s)
if next==s:
return count,s
else:
s=next
count+=1
... | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,761 |
s161062345 | p00108 | u193025715 | 1408517769 | Python | Python3 | py | Accepted | 40 | 6724 | 387 | while True:
n = int(input())
if n == 0:
break
else:
s = list(map(int, input().split(' ')))
times = 0
old_nums = [-1] * n
while old_nums != s:
new_nums = []
for i in s:
new_nums.append(s.count(i))
old_nums = s[::]
s = new_nums[::]
... | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,762 |
s597402399 | p00108 | u899060994 | 1409737790 | Python | Python | py | Accepted | 20 | 4208 | 355 | while True:
n = input()
if n == 0:
break
S = map(int,raw_input().split())
S2 = [0] * n
num = 0
while True:
for i in range(n):
S2[i] = S.count(S[i])
if S2 == S:
break
else:
S, S2 = S2, S
num += 1
print num
for... | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,763 |
s886099823 | p00108 | u814387366 | 1410872991 | Python | Python | py | Accepted | 20 | 4260 | 650 | import sys
class ofa():
def cal(self,n):
list1=map(int,raw_input().split())
dic={}
#while True:
x=0
while True:
for i in range(n):
if list1[i] not in dic:
dic[list1[i]]=1
else :
dic[list1[i]]+=1
pre=list(list1)
for i in range(n):
for j in dic.keys():
if list1[... | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,764 |
s046864988 | p00108 | u912237403 | 1414674787 | Python | Python | py | Accepted | 20 | 4232 | 281 | def f(x):
a=x
c=0
while 1:
A=list(set(a))
B=[a.count(e) for e in A]
b=[B[A.index(e)] for e in a]
if a==b: return c,a
a=b
c+=1
return
while 1:
n=input()
if n==0: break
c,x= f(map(int,raw_input().split()))
print c
print " ".join(map(str,x)) | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,765 |
s450812856 | p00108 | u912237403 | 1414675310 | Python | Python | py | Accepted | 20 | 4220 | 213 | def f(x):
a,c=x,0
while 1:
b=[a.count(e) for e in a]
if a==b: return c," ".join(map(str,a))
else: a,c=b,c+1
while 1:
if input()==0: break
c,s=f(map(int,raw_input().split()))
print c; print s | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,766 |
s917137712 | p00108 | u912237403 | 1414675504 | Python | Python | py | Accepted | 20 | 4220 | 214 | def f(x):
a=x; c=0
while 1:
b=[a.count(e) for e in a]
if a==b: return c," ".join(map(str,a))
else: a=b; c+=1
while 1:
if input()==0: break
c,s=f(map(int,raw_input().split()))
print c; print s | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,767 |
s241894784 | p00108 | u912237403 | 1414920962 | Python | Python | py | Accepted | 30 | 4204 | 177 | while input()!=0:
a=map(int,raw_input().split())
c=0
while 1:
b=[a.count(e) for e in a]
if a==b: break
else: a=b; c+=1
print c
for e in a: print e,
print | p00108 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
| 13,768 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.