GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Thursday, 19 May 2022

[Solution] Z mod X = C Codeforces Solution | Codeforces Problem Solution 2022

B. Z mod X = C
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given three positive integers abc (a<b<c). You have to find three positive integers xyz such that:

xmody=a,
ymodz=b,
zmodx=c.

Here pmodq denotes the remainder from dividing p by q. It is possible to show that for such 

Solution Click Below:-  CLICK HERE

constraints the answer always exists.

Input

The input consists of multiple test cases. The first line contains a single integer t (1t10000) — the number of test cases. Description of the test cases follows.

Each test case contains a single line with three integers abc (1a<b<c108).

Output

For each test case output three positive integers xyz (1x,y,z1018) such that xmody=aymodz=bzmodx=c.

You can output any correct answer.

No comments:

Post a Comment