Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

魚釣り競争 

浩と健次郎の兄弟は猪苗代湖に魚釣りをしに来ました。二人は以下のように点数を決め、釣り上げた魚の合計得点で勝負することにしました。

イワナは１匹 a 点

ヤマメは１匹 b 点

イワナ１０匹ごとに c 点追加

ヤマメ２０匹ごとに d点追加

浩と健次郎が釣り上げた魚の数をもとに、どちらが勝ちか、あるいは引き分けか判定するプログラムを作成せよ。

Input

入力は以下の形式で与えられる。

h1 h2
k1 k2
a b c d

１行目には、浩が釣り上げたイワナの数 h1 (0 ≤ h1 ≤ 100) とヤマメの数 h2 (0 ≤ h2 ≤ 100) が与えられる。２行目には、健次郎が釣り上げたイワナの数 k1 (0 ≤ k1 ≤ 100) とヤマメの数 k2 (0 ≤ k2 ≤ 100) が与えられる。３行目には、イワナ１匹ごとの点数 a(1 ≤ a ≤ 100)、ヤマメ１匹ごとの点数 b (1 ≤ b ≤ 100)、イワナ１０匹ごとの追加点数 c (0 ≤ c ≤ 100)、ヤマメ２０匹ごとの追加点数 d (0 ≤ d ≤ 100) が与えられる。

Output

浩が勝ちなら hiroshi、健次郎が勝ちなら kenjiro 、引き分けなら even と１行に出力する。

Sample Input 1

5 1
3 1
1 2 5 5

Sample Output 1

hiroshi

Sample Input 2

5 1
4 2
1 2 5 5

Sample Output 2

kenjiro

Sample Input 3

0 20
10 0
1 1 10 0

Sample Output 3

even



Sample input:
5 1
3 1
1 2 5 5


Sample output:
hiroshi

Submission status: Wrong Answer

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
H = h1 * a + h2 * b + h1 // 10 * c + h2 // 10 * d
K = k1 * a + k2 * b + k1 // 10 * c + k2 // 10 * d
print('hiroshi' if H>K else 'even' if H==K else 'kenjiro')

Submission status: Wrong Answer

Solution code:
# from sys import exit
h1, h2 = [int(n) for n in input().split()]
k1, k2 = [int(n) for n in input().split()]
a, b, c, d = [int(n) for n in input().split()]

A = h1*a + h1//10*c
A += h2*b + h2//10*d
B = k1*a + k1//10*c
B += k2*b + k2//10*d

if A > B:
    print("hiroshi")
elif A < B:
    print("kenjiro")
else:
    print("even")

Submission status: Wrong Answer

Solution code:
h1, h2 = map(int, raw_input().split())
k1, k2 = map(int, raw_input().split())
a, b, c, d = map(int, raw_input().split())

calc = lambda p, q: p*a+p/10*c+q*b+q/10*d
v1 = calc(h1, h2); v2 = calc(k1, k2)
print["hiroshi", "even", "kenjiro"][(v1<v2)+(v1<=v2)]

Submission status: Wrong Answer

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
v=a*h1+(h1//10)*c+b*h2+(h2//10)*d
w=a*k1+(k1//10)*c+b*k2+(k2//10)*d
print("even" if v==w else ( "hiroshi" if v > w else "kenjiro" ))

Submission status: Wrong Answer

Solution code:
h1,h2 = map(int,input().split())
k1,k2 = map(int,input().split())
a,b,c,d = map(int,input().split())

def f(x,y):
    return a*x + b*y + c*(x//10) + d*(y//10)

H,K = f(h1,h2), f(k1,k2)
ans = 'even'
if H>K:
    ans = 'hiroshi'
elif H<K:
    ans = 'kenjiro'
print(ans)

Submission status: Wrong Answer

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
hiroshi = (a * h1) + (b * h2) + (divmod(h1, 10)[0] * c) + (divmod(h2, 20)[0] * d)
kenjiro = (a * k1) + (b * k2) + (divmod(k1, 10)[0] * c) + (divmod(k2, 20)[0] * d)
print("even" if hiroshi else ["hiroshi", "kenjiro"][hiroshi < kenjiro])

Submission status: Wrong Answer

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
e,f,g,h=h1*a,h2*b,k1*a,k2*b
o,n,m,v=h1//10*c,h2//10*d,k1//10*c,k2//10*d
z,y=o+n+e+f,m+v+g+h
if z>y:
    print("hiroshi")
elif z<y:
    print("kenjiro")
else:
    print("even")

Submission status: Wrong Answer

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
e,f,g,h=h1*a,h2*b,k1*a,k2*b
o,n,m,v=h1//10*c,h2//10*d,k1//10*c,k2//10*d
z,y=o+n+e+f,m+v+g+h
if z>y:
    print("hiroshi")
elif z<y:
    print("kenjiro")
elif z==y:
    print("even")

Submission status: Wrong Answer

Solution code:
h, i = map(int, input().split())
k, l = map(int, input().split())
a, b, c, d = map(int, input().split())
p = h * a + h // 10 * c + i * b + i // 10 * d
q = k * a + k // 10 * c + l * b + l // 10 * d
if p == q:print("even")
else:print("hiroshi" if p > q else "kenjiro")

Submission status: Wrong Answer

Solution code:
def inp():
  return map(int, input().split())

h1, h2 = inp()
k1, k2 = inp()
a, b, c, d = inp()

def point(x1, x2):
  return x1 * a + x2 * b + (x1 // 10) * c + (x2 // 10) * d

ph = point(h1, h2)
pk = point(k1, k2)
if ph > pk:
  print("hiroshi")
elif ph < pk:
  print("kenjiro")
else:
  print("even" )

Submission status: Accepted

Solution code:
hi, hy = map(int, input().split())
ki, ky = map(int, input().split())
a, b, c, d = map(int, input().split())
h = hi * a + hi // 10 * c + hy * b + hy // 20 * d
k = ki * a + ki // 10 * c + ky * b + ky // 20 * d
if h > k: print("hiroshi")
elif h < k: print("kenjiro")
else: print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
H = h1 * a + h2 * b + h1 // 10 * c + h2 // 20 * d
K = k1 * a + k2 * b + k1 // 10 * c + k2 // 20 * d
print('hiroshi' if H>K else 'even' if H==K else 'kenjiro')

Submission status: Accepted

Solution code:
h1,h2 = [int(i) for i in input().split()]
k1,k2 = [int(i) for i in input().split()]
a,b,c,d = [int(i) for i in input().split()]

p1 = a*h1 + c*(h1 // 10) + b*h2 + d*(h2 // 20)
p2 = a*k1 + c*(k1 // 10) + b*k2 + d*(k2 // 20)
if p1 > p2:
    print("hiroshi")
elif p1 < p2:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
# from sys import exit
h1, h2 = [int(n) for n in input().split()]
k1, k2 = [int(n) for n in input().split()]
a, b, c, d = [int(n) for n in input().split()]

A = h1*a + h1//10*c
A += h2*b + h2//20*d
B = k1*a + k1//10*c
B += k2*b + k2//20*d

if A > B:
    print("hiroshi")
elif A < B:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, raw_input().split())
k1, k2 = map(int, raw_input().split())
a, b, c, d = map(int, raw_input().split())

calc = lambda p, q: p*a+p/10*c+q*b+q/20*d
v1 = calc(h1, h2); v2 = calc(k1, k2)
print["hiroshi", "even", "kenjiro"][(v1<v2)+(v1<=v2)]

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
v=a*h1+(h1//10)*c+b*h2+(h2//20)*d
w=a*k1+(k1//10)*c+b*k2+(k2//20)*d
print("even" if v==w else ( "hiroshi" if v > w else "kenjiro" ))

Submission status: Accepted

Solution code:
[h1, h2] = [int(num) for num in input().split()]
[k1, k2] = [int(num) for num in input().split()]
[a, b, c, d] = [int(num) for num in input().split()]

counth = a * h1 + b * h2 + c * (h1 // 10) + d * (h2 // 20)
countk = a * k1 + b * k2 + c * (k1 // 10) + d * (k2 // 20)
if (counth > countk):
    print('hiroshi')
elif (counth < countk):
    print('kenjiro')
else:
    print('even')

Submission status: Accepted

Solution code:
h1,h2 = map(int,input().split())
k1,k2 = map(int,input().split())
a,b,c,d = map(int,input().split())

def f(x,y):
    return a*x + b*y + c*(x//10) + d*(y//20)

H,K = f(h1,h2), f(k1,k2)
ans = 'even'
if H>K:
    ans = 'hiroshi'
elif H<K:
    ans = 'kenjiro'
print(ans)

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
hiroshi = (a * h1) + (b * h2) + (divmod(h1, 10)[0] * c) + (divmod(h2, 20)[0] * d)
kenjiro = (a * k1) + (b * k2) + (divmod(k1, 10)[0] * c) + (divmod(k2, 20)[0] * d)
print("even" if hiroshi == kenjiro else ["hiroshi", "kenjiro"][hiroshi < kenjiro])

Submission status: Accepted

Solution code:
def main():
    h1, h2 = map(int, input().split())
    k1, k2 = map(int, input().split())
    a, b, c, d = map(int, input().split())

    hiroshi = h1 * a + int(h1 / 10) * c + h2 * b + int(h2 / 20) *d
    kenjiro = k1 * a + int(k1 / 10) * c + k2 * b + int(k2 / 20) *d

    if hiroshi > kenjiro:
        print('hiroshi')
    elif kenjiro > hiroshi:
        print('kenjiro')
    else:
        print('even')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

l = []
for input in sys.stdin:
    l.append(input.split())

for i in range(0,len(l)):
    for j in range(0,len(l[i])):
        l[i][j] = int(l[i][j])

if(l[0][0] * l[2][0] + (l[0][0] / 10) * l[2][2] + l[0][1] * l[2][1] + (l[0][1] / 20) * l[2][3] > l[1][0] * l[2][0] + (l[1][0] / 10) * l[2][2] + l[1][1] * l[2][1] + (l[1][1] / 20) * l[2][3]):
    print 'hiroshi'
elif((l[0][0] * l[2][0] + (l[0][0] / 10) * l[2][2] + l[0][1] * l[2][1] + (l[0][1] / 20) * l[2][3] < l[1][0] * l[2][0] + (l[1][0] / 10) * l[2][2] + l[1][1] * l[2][1] + (l[1][1] / 20) * l[2][3])):
    print 'kenjiro'
else:
    print 'even'

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
e,f,g,h=h1*a,h2*b,k1*a,k2*b
o,n,m,v=h1//10*c,h2//20*d,k1//10*c,k2//20*d
z,y=o+n+e+f,m+v+g+h
if z>y:
    print("hiroshi")
elif z<y:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h, i = map(int, input().split())
k, l = map(int, input().split())
a, b, c, d = map(int, input().split())
p = h * a + h // 10 * c + i * b + i // 20 * d
q = k * a + k // 10 * c + l * b + l // 20 * d
if p == q:print("even")
else:print("hiroshi" if p > q else "kenjiro")

Submission status: Accepted

Solution code:
def inp():
  return map(int, input().split())

h1, h2 = inp()
k1, k2 = inp()
a, b, c, d = inp()

def point(x1, x2):
  return x1 * a + x2 * b + (x1 // 10) * c + (x2 // 20) * d

ph = point(h1, h2)
pk = point(k1, k2)
if ph > pk:
  print("hiroshi")
elif ph < pk:
  print("kenjiro")
else:
  print("even" )

Submission status: Accepted

Solution code:
def getScore(i, y):
	return i*a+y*b+c*(i//10)+d*(y//20)


h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())

h, k = getScore(h1, h2), getScore(k1, k2)
if h>k:
	print('hiroshi')
elif h<k:
	print('kenjiro')
else:
	print('even')

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())

hiroshi = h1*a + h1//10*c + h2*b + h2//20*d
kenji = k1*a + k1//10*c + k2*b + k2//20*d

if hiroshi > kenji :
    print('hiroshi')
elif hiroshi < kenji :
    print('kenjiro')
else :
    print('even')

Submission status: Accepted

Solution code:

import math

h1,h2 =map(int,input().split())
k1,k2 =map(int,input().split())
a,b,c,d =map(int,input().split())

hp = a * h1 + b * h2 + c * math.floor(h1/10) + d * math.floor(h2/20)
kp = a * k1 + b * k2 + c * math.floor(k1/10) + d * math.floor(k2/20)

if hp > kp:
    print("hiroshi")
elif hp == kp:
    print("even")
else:
    print("kenjiro")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
hiroshi = h1*a + h2*b + (h1//10)*c + (h2//20)*d;
kenjiro = k1*a + k2*b + (k1//10)*c + (k2//20)*d;

if hiroshi > kenjiro: print("hiroshi")
elif hiroshi < kenjiro: print("kenjiro")
else: print("even")

Submission status: Accepted

Solution code:
#標準入力
ha,hb = map(int,input().split())
ka,kb = map(int,input().split())
a,b,c,d = map(int,input().split())
ht,kt = 0,0

#得点の計算
ht = ha * a + hb * b + (ha // 10) * c + (hb // 20) * d
kt = ka * a + kb * b + (ka // 10) * c + (kb // 20) * d

#得点が大きいほう、または引き分けを出力する
if ht > kt:print("hiroshi")
elif ht < kt:print("kenjiro")
elif ht == kt:print("even")

Submission status: Accepted

Solution code:
h1, h2 = list(map(int, input().split()))
k1, k2 = list(map(int, input().split()))
a,b,c,d = list(map(int, input().split()))

hiro = h1*a + h2*b + (h1//10)*c + (h2//20)*d
ken = k1*a + k2*b + (k1//10)*c + (k2//20)*d
if hiro>ken:
    print('hiroshi')
elif ken>hiro:
    print('kenjiro')
else:
    print('even')

Submission status: Accepted

Solution code:
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop
import copy
from test.support import _MemoryWatchdog

BIG_NUM = 2000000000
HUGE_NUM = 99999999999999999
MOD = 1000000007
EPS = 0.000000001
sys.setrecursionlimit(100000)



h1,h2 = map(int,input().split())
k1,k2 = map(int,input().split())
a,b,c,d = map(int,input().split())

A = a*h1+(h1//10)*c+b*h2+(h2//20)*d
B = a*k1+(k1//10)*c+b*k2+(k2//20)*d

if A > B:
    print("hiroshi")
elif A < B:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
h=h1*a+h2*b+h1//10*c+h2//20*d
k=k1*a+k2*b+k1//10*c+k2//20*d
if h>k:
    print('hiroshi')
elif k>h:
    print('kenjiro')
else:
    print('even')

Submission status: Accepted

Solution code:
h1, h2 = [int(_) for _ in input().split()]
k1, k2 = [int(_) for _ in input().split()]

a, b, c, d = [int(_) for _ in input().split()]

s = (h1-k1)*a + (h2-k2)*b + ((h1//10)-(k1//10))*c + ((h2//20)-(k2//20))*d

if s > 0:
    print('hiroshi')
elif s < 0:
    print('kenjiro')
else:
    print('even')

Submission status: Accepted

Solution code:
h1,h2 = map(int,input().split())
k1,k2 = map(int,input().split())
a,b,c,d = map(int,input().split())
h = h1*a+h2*b+h1//10*c+h2//20*d
k = k1*a+k2*b+k1//10*c+k2//20*d
if h < k:
    print("kenjiro")
elif h > k:
    print("hiroshi")
else:
    print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
h = h1*a + h2*b + h1//10*c + h2//20*d
k = k1*a + k2*b + k1//10*c + k2//20*d
if h > k:
    print('hiroshi')
elif h == k:
    print('even')
else:
    print('kenjiro')

Submission status: Accepted

Solution code:
hi,hy=map(int,input().split())
ki,ky=map(int,input().split())
a,b,c,d=map(int,input().split())
ha=int(hi/10)
hb=int(hy/20)
ka=int(ki/10)
kb=int(ky/20)
H=hi*a+hy*b+ha*c+hb*d
K=ki*a+ky*b+ka*c+kb*d
if H>K:
    print("hiroshi")
elif H==K:
    print("even")
else:
    print("kenjiro")

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())

ha, hb,ka,kb = h1*a, h2*b, k1*a, k2*b
h10, h20, k10, k20 = h1//10*c, h2//20*d, k1//10*c, k2//20*d
H, K = ha + hb + h10 + h20, ka + kb + k10 + k20
if H > K:
    print("hiroshi")
elif K > H:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h,i = map(int,input().split(" "))
k,j = map(int,input().split(" "))
a,b,c,d = map(int,input().split(" "))

s=h*a+i*b+(h//10)*c+(i//20)*d
r=k*a+j*b+(k//10)*c+(j//20)*d

if s > r:
  print("hiroshi")
elif s == r:
  print("even")
else:
  print("kenjiro")

Submission status: Accepted

Solution code:
h1, h2 = map(int,input().split())
k1, k2 = map(int,input().split())
a, b, c, d = map(int,input().split())

if h1 > 9:
    hn = int(h1/10)
else:
    hn = 0
if h2 > 19:
    hm = int(h1/20)
else:
    hm = 0
if k1 > 9:
    kn = int(k1/10)
else:
    kn = 0
if k2 > 19:
    km = int(k2/20)
else:
    km = 0
    
h = h1*a + hn*c + h2*b + hm*d 
k = k1*a + kn*c + k2*b + km*d 

if h<k:
    print("kenjiro")
elif k<h:
    print("hiroshi")
elif h == k:
    print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())
 
hiroshi = h1 * a + (h1//10) * c + h2 * b + (h2//20) * d
kenjiro = k1 * a + (k1//10) * c + k2 * b + (k2//20) * d
 
if hiroshi > kenjiro:
  print("hiroshi")
elif hiroshi < kenjiro:
  print("kenjiro")
else:
  print("even")

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
hp=h1*a+h2*b+(h1//10)*c+(h2//20)*d
kp=k1*a+k2*b+(k1//10)*c+(k2//20)*d
if hp>kp:
    print("hiroshi")
elif kp>hp:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())

hiroshi = h1 * a + (h1//10) * c + h2 * b + (h2//20) * d
kenjiro = k1 * a + (k1//10) * c + k2 * b + (k2//20) * d

if hiroshi > kenjiro:
  print("hiroshi")
elif hiroshi < kenjiro:
  print("kenjiro")
else:
  print("even")

Submission status: Accepted

Solution code:
h, k = [list(map(int, input().split())) for i in range(2)]
a, b, aa, bb = map(int, input().split())

hp = h[0]*a + h[1]*b
hp += h[0]//10*aa + h[1]//20*bb

kp = k[0]*a + k[1]*b
kp += k[0]//10*aa + k[1]//20*bb

if kp!=hp: print("hkiernojsihrio"[kp>hp::2])
else: print("even")

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
x=h1*a+h2*b+(h1//10)*c+(h2//20)*d
y=k1*a+k2*b+(k1//10)*c+(k2//20)*d
if x==y:
  print("even")
elif x<y:
  print("kenjiro")
else:
  print("hiroshi")

Submission status: Accepted

Solution code:
h1,h2=map(int,input().split())
k1,k2=map(int,input().split())
a,b,c,d=map(int,input().split())
hiro=a*h1+b*h2+(h1//10)*c+(h2//20)*d
kenji=a*k1+b*k2+(k1//10)*c+(k2//20)*d
if hiro>kenji:
    print("hiroshi")
elif hiro<kenji:
    print("kenjiro")
else:
    print("even")

Submission status: Accepted

Solution code:
h1, h2 = map(int, input().split())
k1, k2 = map(int, input().split())
a, b, c, d = map(int, input().split())

hiroshi = h1*a + h1//10*c + h2*b + h2//20*d
kenjiro = k1*a + k1//10*c + k2*b + k2//20*d

if hiroshi > kenjiro:
    print("hiroshi")
elif hiroshi < kenjiro:
    print("kenjiro")
else:
    print("even")