Problem 1

[Back]

Before you do anything else, it seems like you'll have to find the elves, which have apparently vanished for some reason. After some exploration, you eventually find two elves partying in one of the abandoned dorm rooms. The elves generally party for most of January to celebrate a successful year of present delivery, but you didn't expect them to restart so soon and be so unconcerned with their surroundings.

You're fairly quickly able to convince the elves that they should instead try to help. Feeling successful, you go to another room with 10 elves, who are a lot harder to convince. You think that the number of minutes it'll take to convince a group of elves to help instead of partying is the square of the number of elves in the group.

Before trying to convince any more elves, you explore the dorms (trying to stay clear of a fire that is somehow still burning in one of them) to try to figure out how many elves are in each room. You record the number of elves in each room in your input, and you want to figure out how many minutes it will take to stop all of their parties.

For example (this example, like all the other examples, is only meant to clarify the problem and won't otherwise be helpful to you in any way), if your input were 16 11 4 20 20 7 10 13 3 14, then it would take you 256 minutes to stop the first party, 121 minutes to stop the second, 16 minutes to stop the third, and so on, leading to the output of 1716 total minutes.

To begin, get your problem input. You feel that this problem will take 3 lines of code.

Answer: [Submit]