Đếm bội số

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 1.0s
Memory limit: 1G
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Cho bốn số nguyên L,R,a,b hãy đếm số lượng các bội số của a hoặc b có giá trị thuộc đoạn [L,R]

Đầu vào: Dòng đầu tiên chứa số nguyên T cho biết số bộ dữ liệu cần kiểm tra. Mỗi bộ dữ liệu gồm một dòng chứa 4 số nguyên L,R,a,b

Đầu ra: Ứng với mỗi bộ dữ liệu đầu vào in ra kết quả tương ứng.

Ví dụ:
Input
Copy
2
5 11 4 6
3 1000 5 9
Output
Copy
2
289

Comments

Please read the guidelines before commenting.



  • 0
    NoobCpp  commented 3:11:30 pm, 07/11/2024

    https://ideone.com/bCZTWJ


  • 0
    anhtuan2007  commented 8:19:02 am, 19/09/2022

    iloveameliawatson><