[Solution] Divisible Numbers (easy version) Codeforces Solution
E1. Divisible Numbers (easy version)
time limit per test
4 secondsmemory limit per test
256 megabytesinput
standard inputoutput
standard outputThis is an easy version of the problem. The only difference between an easy and a hard version is the constraints on , , and .
You are given positive integers , , , with and . Find any pair of numbers and that satisfies the following conditions:
- , ,
- is divisible by .
Note that required and may not exist.
Input
The first line of the input contains a single integer ), the number of test cases.
👇👇👇👇👇
The descriptions of the test cases follow.
The only line of each test case contains four integers , , and (, ).
Output
For each test case print a pair of numbers and such that is divisible by . If there are multiple answers, print any of them. If there is no such pair of numbers, then print -1 -1.
No comments:
Post a Comment