HP and Divisibility of numbers
Practice
0 (0 votes)
Mathematics
Easy
Mathematics
Mathamatics
Problem
52% Success 8441 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
HP is doing research in mathematics . After doing lots of research, she struck in a problem . She found four numbers n,a, b and c .Now, She wants to know how many number exists which are less than or equal to n and are divisible by a ,b or c .
Input : First line contains 't' denoting numbers of test cases
Next t lines contains 4 integers denoting n,a,b and c separated by space
Output : 't' lines containing the count of the numbers which are divisible a,b,c
Constraints :
\(1 \le t \le 10^5\)
\(1 \le n \le 10^9\)
\(1 \le a,b,c \le 10^5\)
Submissions
Please login to view your submissions
Similar Problems
Points:20
5 votes
Tags:
EasyNumber Theory
Points:20
27 votes
Tags:
Brute-force searchMathematicsApprovedEasy
Points:20
836 votes
Tags:
Ad-HocSimulationEasyMathematicsOpenApprovedMathamatics
Editorial