|
||||||||||
TakeawayTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 166 Accepted Submission(s): 134 Problem Description After CET-6, Kanari wants to order a takeaway to reward himself. He opens choutuan app and starts to choose what to eat for his dinner. There are 7 types of dishes in total, the price of which are $7, 27, 41, 49, 63, 78, 108$ yuan respectively. Kanari has three coupons: 1. When the price reaches $69$ yuan, you will get $15$ yuan off. 2. When the price reaches $89$ yuan, you will get $30$ yuan off. 3. When the price reaches $120$ yuan, you will get $50$ yuan off. Kanari can only use one coupon each time and each coupon can only be used once. For each order, the app will always choose the best coupon for him. For example, if the overall price of his order is $300$ yuan, he will need to pay $250$ yuan. Now Kanari ordered $n$ dishes, $a_1, a_2, a_3, ..., a_n$, denoting the types of the dishes respectively. He wants to know how much he will spend on his dinner. Input This problem contains multiple test cases. The first line contains a single integer $T$ ($1\leq T\leq 10^6$) indicating the number of test cases. Then $T$ cases follow, each of which contains two lines. The first line of each test case contains an integer $n$ ($1\leq n\leq 7$), the number of dishes Kanari ordered. The second line contains $n$ integers $a_1,a_2,...,a_n$. ($1\leq a_i\leq 7$) indicating the dishes Kanari ordered. Output For each test case, output the money Kanari spends in a single line. Sample Input
Sample Output
Source | ||||||||||
|