positive integers (a,b) is called uncommon if ⌊ab⌋=amodb. Here, ⌊ab⌋ is the consequence of the integer division among an and b, while amodb is its remaining portion.    You are given two integers x and y. Track down the number of uncommon sets (a,b) to such an extent that 1≤a≤x and 1≤b≤y.    Input

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 pair of positive integers (a,b) is called uncommon if ⌊ab⌋=amodb. Here, ⌊ab⌋ is the consequence of the integer division among an and b, while amodb is its remaining portion. 

 

You are given two integers x and y. Track down the number of uncommon sets (a,b) to such an extent that 1≤a≤x and 1≤b≤y. 

 

Input 

 

The main line contains a solitary integer t (1≤t≤100) — the number of experiments. 

 

The main line of the depiction of each experiment contains two integers x, y (1≤x,y≤109). 

 

Output 

 

For each experiment print the appropriate response on a solitary line.

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Topological Sort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr