Back
Close

The power of sum

Statement

 Goal

You must sum of the following values:
- A! when A is smaller then 12
- A/2 when the number is bigger then 50
- A*2 otherwise
Input
Line 1: An integer N for the number to sum.
Next N lines: An Integer A.
Output
Line 1: Sum of the following values:
- A! when A is smaller then 12
- A/2 when the number is bigger then 50
- A*2 otherwise
Line 2 : Divide the first line for 1000 and change it to ascii
Line 3 : Divide the first line for 1000 and change it to hex
Constraints
2 ≤ N ≤ 10
2 ≤ A ≤ 100
Example
Input
10
1
2
3
4
5
6
7
9
9
10
Output
4360483
ᄈ
0x1108

Game modes
Fastest, Shortest

Test cases
Test
Input
10 1 2 3 4 5 6 7 9 9 10
Output
4360483 ᄈ 0x1108

Validator
Input
10 4 5 6 7 8 9 10 11 12 13
Output
43954764 ꮲ 0xabb2

Test
Input
10 4 6 8 10 12 14 16 18 20 22
Output
3670078 ๖ 0xe56

Validator
Input
10 3 6 9 12 15 18 21 24 27 30
Output
363910 ū 0x16b

Test
Input
10 67 40 43 69 55 88 39 68 9 83
Output
363347 ū 0x16b

Validator
Input
10 20 72 5 32 60 60 32 21 50 65
Output
493 ǭ 0x1ed

Test
Input
10 33 8 94 93 55 16 31 85 77 78
Output
40729 鼙 0x9f19

Validator
Input
10 90 46 11 58 78 86 73 36 63 50
Output
39917222 鯭 0x9bed

Solution language

Solution

Stub generator input