We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #5: Smallest multiple

Project Euler #5: Smallest multiple

Contest ends in
Problem
Submissions
Leaderboard
Discussions

HackerRank

|
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #5: Smallest multiple
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions

This problem is a programming version of Problem 5 from projecteuler.net

is the smallest number that can be divided by each of the numbers from to without any remainder.
What is the smallest positive number that is evenly divisible(divisible with no remainder) by all of the numbers from to ?

Input Format

First line contains that denotes the number of test cases. This is followed by lines, each containing an integer, .

Constraints

Output Format

Print the required answer for each test case.

Sample Input 0

2
3
10

Sample Output 0

6
2520

Explanation 0

  • You can check is divisible by each of , giving quotient of respectively.
  • You can check is divisible by each of giving quotient of respectively.
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy