#Qua2302. TheBigFatDuck eat Laoxiangji
TheBigFatDuck eat Laoxiangji
Background
TheBigFatDuck and his girlfriend, TheHamster, are strolling in Crystal City.
TheBigFatDuck: "I've been trying to lose weight recently, and I'm so hungry. What should we eat?"
TheHamster: "Coincidentally, there's a Laoxiangji that serves our hometown dish. What do you think?"
TheBigFatDuck: "Hahaha, it's indeed a true 'hometown' chicken for us. Let's go."
They enter the restaurant and approach the counter.
TheBigFatDuck: "I'd like one dish of Braised Pork with Preserved Vegetables(梅菜扣肉), one dish of Sour Cabbage Fish(金汤酸菜鱼), one dish of Scallion Oil Chicken(葱油鸡), and one dish of Country-Style Steamed Egg(农家蒸蛋)."
TheHamster chuckles: "Aren't you trying to lose weight? Why are you ordering so much? Well, I'll have one large portion of Fei Xi Lao Mu Chicken Soup(大份肥西老母鸡汤), one dish of Steamed Phoenix Tripe with Sauce(酱蒸凤肚), one dish of Tomato Fried Eggs(西红柿炒鸡蛋), and one dish of Spicy Chicken Giblets(香辣鸡杂)."
Waiter: "The total is 153 yuan. Would you like to sign up for our Super Member program? For just 3 yuan, you can enjoy an 12% discount on each meal for the next 7 days, with a maximum discount of 5 yuan per meal.Formally, if your original is , your cost will be after becoming Super Member."
TheBigFatDuck fell into deep thought. If he only considers this one meal, becoming a Super Member is indeed cost-effective, as the total price would be yuan. Furthermore, if he knows his future dining plans at Laoxiangji in advance, he can calculate the optimal cost.
TheHamster: "Oh, come on. Let me treat you to this meal."
Description
TheBigFatDuck has listed his daily cost for dining at Laoxiangji for the next n days, denoted as . Here, represents the cost of having just one meal at Laoxiangji on the i-th day. Specifically, if , it means that TheBigFatDuck will not dine at Laoxiangji on the i-th day. He hopes to become a Super Member at the right time to minimize the total cost at Laoxiangji over these n days.
Format
Input
Two lines.
The first line contains an integer n, representing the number of planned days .
The second line contains n integers , where represents the original cost on the i-th day.
Output
Two lines.
The first line contains a decimal number, rounded to two decimal places, representing the minimum total cost at Laoxiangji over these n days.
The second line contains several integers , where the i-th integer indicates a day on which TheBigFatDuck plans to become a Super Member.
Special Judge: Your output will be considered acceptable only if the first line equals the standard answer, and your plan can precisely compute the result of the first line.
Sample
8
1 50 50 50 50 50 50 50
319
2
8
50 50 50 50 0 50 50 50
321
1 8
For line2 of output2, 1 2
, 8 1
are also acceptable answers. But 1 1 2
, 2 3
are wrong answers.
Limitation
1s, 128MB
Broadcast: "Customer on the 23rd, please pick up your meal."
TheBigFatDuck: "I'll pick up the meal."
TheHamster: "Let's toast with chicken soup to commemorate our youthful moments, as dazzling as fireworks."
TheBigFatDuck: "Sounds great."
相关
在下列比赛中: