MAT

Riddle #11

Find the sum of the prime numbers less than N (excluded).

If there is more than one combination, write the largest product. If there are no combinations, write 0.

Costraints

1 < N < 106

Example

If N = 12, primes below N are:

2, 3, 5, 7, 11

and their sum is:

28.

Your program

<?php
    
function main($N) {

  $return = 0;
  /* Scrivi la tua funzione qui */
  
  return $return;
}
  
$IN = (array) json_decode(base64_decode($argv[1]));
extract($IN);
echo main($N);
?>

Your input

{ 
  "N": 12 
}

Your output

-

Correct output

28

0 0 votes
Article Rating
Notifiche
Notificami
0 Comments
Inline Feedbacks
View all comments