Modulo Pair
CodeChefOpen on judge ↗
Problem Description Given Two Numbers N and K. Find the number of pairs (a,b) such that a%b == K where 1 Input The first line consists of T test cases. Each of the testcase consists of two integers N and K separated by space. Output Print the number of pairs in new line for each test case. Constraints - 1 ≤ T ≤ 100 - 1 ≤ N ≤ 100000 - 1 ≤ K ≤ 100000 Example Input: 1 4 2 Output: 2 E
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start