You are given a series 1, 1, 2, 3, 5, 8,.... . Your task is to tell the position of Nth multiple of a number - A. Both A and Nth multiple are part of the given series.
The first line of input contains an integer T denoting the Test cases. Then T test cases follow.
Second line contains Skill value of N
Third line contains Skill value of A
Position of Nth multiple of A in the given series(indexing starting from 1)
1 ≤ T ≤ 50
1 ≤ N ≤ 10^8
1 ≤ A ≤ 10^8
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.