{"raw_statement":[{"iden":"problem statement","content":"A supermarket sells egg packs.\nA pack of $6$ eggs costs $S$ yen, a pack of $8$ eggs costs $M$ yen, and a pack of $12$ eggs costs $L$ yen.\nWhen you can buy any number of each pack, find the minimum amount of money required to purchase at least $N$ eggs."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   $1 \\leq S,M,L \\leq 10^4$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $S$ $M$ $L$"},{"iden":"sample input 1","content":"16 120 150 200"},{"iden":"sample output 1","content":"300\n\nIt is optimal to buy two $8$\\-egg packs."},{"iden":"sample input 2","content":"10 100 50 10"},{"iden":"sample output 2","content":"10\n\nIt is optimal to buy one $12$\\-egg pack."},{"iden":"sample input 3","content":"99 600 800 1200"},{"iden":"sample output 3","content":"10000\n\nIt is optimal to buy five $8$\\-egg packs and five $12$\\-egg packs."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}