MAT

Riddle #6

Finds the smallest divisible number for all integers from 1 to M.

Constraints

1 < M < 3*101

Example

The smallest number divisible for all integers from 1 to M = 10
è: 2520

Your program

<?php
    
function main($M) {

  $return = 0;
  /* Write you function here */
  
  return $return;
}
  
$IN = (array) json_decode(base64_decode($argv[1]));
extract($IN);
echo main($M);
?>

Your input

{ 
  "M": 10 
}

Your output

-

Correct output

2520

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