Back
Close

Primes

Statement
Your mission is to find the <<sum>> of all the <<primes>> between 2 to [[N]] (including [[N]]) <<divided>> by the number of primes. <<NOTE:>> If the number is not an integer you need to round it. For example: [[N]] = 7 (2+3+5+7) / 4 = 4.25 4.25 isn't integer so the output is: <<4>>

Input description
[[N]]: an integer

Output description
The <<sum>> of all the <<primes>> from 2 to [[N]] (including [[N]]) <<divided>> by the number of primes. <<NOTE:>> If the number is not an integer you need to round it.

Constraints
[[N]] > 2

Game modes
Shortest

Test cases
Test 1 Test
Input
7
Output
4

Validator 1 Validator
Input
12
Output
6

Test 2 Test
Input
50
Output
22

Validator 2 Validator
Input
1000
Output
453

Test 3 Test
Input
3332
Output
1534

Validator 3 Validator
Input
11111
Output
5174

Test 4 Test
Input
12345
Output
5748

Validator 4 Validator
Input
54321
Output
25602

Solution language

Solution

Stub generator input