Count Special
Practice
5 (1 votes)
Math
Problem
60% Success 90 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You have given an integer \(N\). An integer will be special to us if it is divisible by either A or B or C. Now you have to count the total number of numbers between the range \([1,N]\) that is special.

Input format:

  • First line: An integer \(T\) denoting the number of test cases.
  • For each test case:
  1. First line: An integer \(N\).
  2. Second line: Three interger A, B and C

Output format:

  • For each test case print an integer that counts of the special numbers in a new line.

Constraints:

    \(1 \leq T \leq 10^6\)

    \(1 \leq N \leq 10^6\)

    \(1 \leq A, B,C \leq 100\)

Author: Suman Pramanik

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
2 votes
Points:20
1 votes
Tags:
EasyMath
Points:20
2 votes
Tags:
EasyNumber Theory
Editorial

No editorial available for this problem.