Prime Pancakes (pancakes)

8 teams scored 450 points on this task, for a maximum score of 100, an average score of 56 and a median score of 30.

Highlights

  1. Volta, Milano is the institute with the most points (100).
  2. Lombardia is the region with the most points (130).

Statement

Stefan just bought a pancake shop, and he's going to sell N different kinds of pancake there. Each pancake is labeled with an integer number L_i. The label is a positive integer up to 6 digits long (1 < L_i < 999999). Different kinds of pancake can sometimes have the same label. In a few hours the store will be open for business, but Stefan just remembered that he still hasn't decided the prices of each pancake type! In a hurry, Stefan decided to use his imagination and came up with a really interesting algorithm for deciding the price of a pancake. Since Stefan loves prime numbers, the price is going to depend on "how prime" a pancake is: (1) The starting price of a pancake is B euro. (2) If the label's value L_i is prime, the price is increased by L_i + a "primeness bonus" of P euro. (3) For each digit d of the label: if d is prime (that is, if it's either 2, 3, 5, or 7) then the price of the pancake will be increased by a corresponding fixed amount (D_2, D_3, D_5, or D_7 euro)...