You are given three numbers $a$, $b$, $c$ . Write a program to determine the largest number that is less than or equal to $c$ and leaves a remainder $b$ when divided by $a$.
-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow.
- Each testcase contains a single line of input, having three integers $a$, $b$, $c$.
-----Output:-----
- For each testcase, output in a single line the largest number less than or equal to $c$.
-----Constraints:-----
- $1 \leq T  \leq 100000$
- $0 \leq b < a < c \leq$ $10$^18
-----Sample Input:-----
1
7 2 10
-----Sample Output:-----
9
# cook your dish here
t = int(input())
for i in range(0,t):
    a=input().split()
    b=list(map(int,a))
    n=int(b[2]/b[0])
    if((b[0])*n+b[1]<=b[2]):
        print((b[0])*n+b[1])
    else:
        print((b[0])*(n-1)+b[1])
# cook your dish here
t = int(input())
for i in range(0,t):
    a=input().split()
    b=list(map(int,a))
    n=int(b[2]/b[0])
    if((b[0])*n+b[1]<=b[2]):
        print((b[0])*n+b[1])
    else:
        print((b[0])*(n-1)+b[1])