The Power of the Hero
In Petryk's game, each hero possesses 4 combat attributes: attack power, defense power, magic power, and knowledge power. Initially, these attributes are assigned random values. As the hero gains experience and levels up, the player can increase any one of these attributes by 1 for each level gained.
Petryk believes that a hero's effectiveness is calculated by the sum of the squares of their attributes. On the other hand, Vasya thinks that effectiveness is determined by the product of these attributes.
Kolya is unsure and seeks your assistance to determine the maximum effectiveness his hero can achieve using both Petryk's and Vasya's formulas after leveling up a specified number of times.
Input
The first line contains four numbers A, D, M, K — the initial combat attributes of Kolya's hero. The second line contains the number of level-ups. All numbers are non-negative integers and do not exceed 10000.
Output
Output two integers — the maximum effectiveness the hero can achieve according to Petryk's formula, and the maximum effectiveness according to Vasya's formula.