Back
Close

Primes

Statement

 Goal

Your mission is to find the average of primes between 2 to N (including N).

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
N: an integer
Output
The average of primes between 2 to N (including N).

NOTE: If the number is not an integer you need to round it.
Constraints
100000 > N > 2
Example
Input
7
Output
4

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

Test 5 Test
Input
87645
Output
41473

Without round Validator
Input
241
Output
110

Solution language

Solution

Stub generator input