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\)
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
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
11 votes
Tags:
MathematicsOpenApprovedEasyMathamatics
Points:20
10 votes
Tags:
ImplementationMath BasicBasics of ImplementationC++Basic MathMathGame Theory
Points:20
3 votes
Tags:
ObservationBasic MathAlgorithmsBasics of Greedy AlgorithmsMath
Editorial
Login to unlock the editorial