{ "question": "To make a call from a payphone, you must pay $0.25 for each minute of your call. After 16 minutes, that price drops to $0.2 per minute. How much would a 36-minute call cost?", "answer": "First 16 minutes would be a cost of 16 * 0.25 = $<<16*0.25=4>>4.\nAfter that, there are 36 - 16 = <<36-16=20>>20 minutes of the call left.\nAnd these 20 minutes cost 20 * 0.2 = $<<20*0.2=4>>4.\nSo in total, the 36-minute call would cost 4 + 4 = $8.\n#### 8", "id_orig": 1223, "id_shuffled": 10, "question_annotated": "To make a call from a {dev,payphone}, you must pay {currency,$}{frac1,0.25} for each minute of your call. After {t,16} minutes, the price drops to {currency,$}{frac2,0.2} per minute. After {t2,10} minutes from the start of the call, the price drops even more to {currency,$}{frac3,0.5} per two minutes. If your total bill is more than {currency,$}{limit,15}, you get a {disc,10}% discount on your total bill. How much would a {total,36}-minute call cost?\n\n#init:\n- dev = sample(['phone booth', 'hotel room phone'])\n- currency = sample(currencies_sym)\n- $frac1 = sample(fraction_decimals)\n- $frac2 = sample(fraction_decimals)\n- $frac3= sample(fraction_decimals)\n- $t = range(5, 18)\n- $t2 = range(20, 45)\n- $total = range(55, 121, 5)\n- $disc = range(10, 21, 5)\n- $limit = range(15, 31, 10)\n\n#conditions:\n- is_int(frac1 * t)\n- is_int((t2-t) * frac2)\n- is_int((total-t2) / 2 * frac3)\n- t + 10 < t2 < total\n- divides(total-t2,2)\n- frac3 < frac2 < frac1\n- int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) > limit\n- is_int(int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) * (disc / 100))\n\n#answer: int(int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 )* (1-disc/100))", "answer_annotated": "First {t} minutes would be a cost of {t} * {frac1} = {currency}<<{t}*{frac1}={int(t*frac1)}>>{int(t*frac1)}.\nAfter that, the next {t2} - {t} = <<{t2}-{t}={t2-t}>>{t2-t} minutes of the call will cost {frac2}.\nAnd these {t2-t} minutes cost {t2-t} * {frac2} = {currency}<<{t2-t}*{frac2}={int((t2-t)*frac2)}>>{int((t2-t)*frac2)}.\nThen from {t2} to {total}, there are {total}-{t2}={total-t2} minutes that cost {frac3} per two minutes. Since there are {total-t2} / 2 = {(total-t2)//2} intervals of two minutes, the cost for final part of the call will be {frac3} * {(total-t2)//2} = {int(frac3 * (total-t2) * 0.5 )}.\nOverall the cost is {int(t*frac1)} + {int((t2-t)*frac2)} + {int(frac3 * (total-t2) * 0.5 )} = { int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 )}.\nSince { int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 )} > {limit}, we get a {disc}% discount. {disc}% * { int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 )} = { int(int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) * disc/100)}. So the total bill is { int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 )} - { int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) * disc/100} = { int(int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) * (1-disc/100))} \n#### { int(int((frac1 * t) + frac2*(t2-t) + frac3 * (total-t2) * 0.5 ) * (1-disc/100) )}" }