# H A D # 一行に、敵の体力Hと通常攻撃のダメージ量A、必殺技のダメージ量Dが半角スペース区切りで与えられる。 # 1≤H,A,D≤10000 import sys line=sys.stdin.readline() line1=line.split() enemyHP = int(line1[0]) normalDamage=int(line1[1]) criticalDamage=int(line1[2]) INF=10e9 # HPに対する最小期待回数の配列 HPandAttackCount=[INF for i in range(enemyHP+1)] HPandAttackCount[0]=0; for hp in range(1,enemyHP+1): # 計算済みでない場合のみ計算 if HPandAttackCount[hp] != INF: continue # 現在ループ中のhpに対する対象の回数期待値を求める # 必殺技は、2/3回しか当たらないので、1.5回とみなせば良いらしい # 通常! if 0<=hp-normalDamage: HPandAttackCount[hp] = min(HPandAttackCount[hp], \ HPandAttackCount[hp-normalDamage]+1.0 ) else: HPandAttackCount[hp] = min(HPandAttackCount[hp], 1.0 ) # 必殺! if 0<=hp-criticalDamage: HPandAttackCount[hp] = min(HPandAttackCount[hp], \ HPandAttackCount[hp-criticalDamage]+1.5 ) else: HPandAttackCount[hp] = min(HPandAttackCount[hp], 1.5 ) # for dp in HPandAttackCount: # print(dp) print( HPandAttackCount[enemyHP] )