{"id":"14b00f51-eb0f-449f-bd83-b536388a62fb","name":"Gcd Length","description":"\r\nYou are given three integers a,b and c.\r\n\r\nFind two positive integers x and y (x>0 & y>0) such that:\r\n\r\n1.the decimal representation of x without leading zeroes consists of \"a\" digits;\r\n2.the decimal representation of y without leading zeroes consists of \"b\" digits;\r\n3.the decimal representation of gcd(x,y) without leading zeroes consists of c digits.\r\ngcd(x,y) denotes the greatest common divisor (GCD) of integers x and y.\r\n\r\nOutput x and y.","inputFormat":"The first line contains an integer T, number of test cases.\r\nThe next t lines contain three integers a and b and c.","outputFormat":"For each test case print two positive integers x and y.","constraints":"1 <= t <= 200\r\n1 <= a,b <= 9\r\n1<= c <= min(a,b)","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.BufferedReader;\r\nimport java.io.IOException;\r\nimport java.io.InputStreamReader;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws NumberFormatException, IOException {\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"4\r\n2 3 1\r\n2 2 2\r\n6 6 2\r\n1 1 1\r\n","sampleOutput":"16 243\r\n10 10\r\n163840 196830\r\n1 1\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"086949fa-3c5e-40c6-8a9c-f9be4b400318","name":"Number Theory For Experts","slug":"number-theory-for-experts","type":0},{"id":"7895bed5-165d-490e-a881-1ccfc76b73fb","name":"Gcd Length","slug":"gcd-length","type":1}],"next":{"id":"c406e72a-1c68-4993-b98b-2a51ad2de329","name":" I Hate 1111","type":1,"slug":"i-hate-1111"},"prev":{"id":"ca5aa38f-bc98-4278-86dc-a8a6106aef3e","name":"Count Of Common Divisors","type":1,"slug":"count-of-common-divisors"}}}

Gcd Length

You are given three integers a,b and c. Find two positive integers x and y (x>0 & y>0) such that: 1.the decimal representation of x without leading zeroes consists of "a" digits; 2.the decimal representation of y without leading zeroes consists of "b" digits; 3.the decimal representation of gcd(x,y) without leading zeroes consists of c digits. gcd(x,y) denotes the greatest common divisor (GCD) of integers x and y. Output x and y.

{"id":"14b00f51-eb0f-449f-bd83-b536388a62fb","name":"Gcd Length","description":"\r\nYou are given three integers a,b and c.\r\n\r\nFind two positive integers x and y (x>0 & y>0) such that:\r\n\r\n1.the decimal representation of x without leading zeroes consists of \"a\" digits;\r\n2.the decimal representation of y without leading zeroes consists of \"b\" digits;\r\n3.the decimal representation of gcd(x,y) without leading zeroes consists of c digits.\r\ngcd(x,y) denotes the greatest common divisor (GCD) of integers x and y.\r\n\r\nOutput x and y.","inputFormat":"The first line contains an integer T, number of test cases.\r\nThe next t lines contain three integers a and b and c.","outputFormat":"For each test case print two positive integers x and y.","constraints":"1 <= t <= 200\r\n1 <= a,b <= 9\r\n1<= c <= min(a,b)","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.BufferedReader;\r\nimport java.io.IOException;\r\nimport java.io.InputStreamReader;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws NumberFormatException, IOException {\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"4\r\n2 3 1\r\n2 2 2\r\n6 6 2\r\n1 1 1\r\n","sampleOutput":"16 243\r\n10 10\r\n163840 196830\r\n1 1\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"086949fa-3c5e-40c6-8a9c-f9be4b400318","name":"Number Theory For Experts","slug":"number-theory-for-experts","type":0},{"id":"7895bed5-165d-490e-a881-1ccfc76b73fb","name":"Gcd Length","slug":"gcd-length","type":1}],"next":{"id":"c406e72a-1c68-4993-b98b-2a51ad2de329","name":" I Hate 1111","type":1,"slug":"i-hate-1111"},"prev":{"id":"ca5aa38f-bc98-4278-86dc-a8a6106aef3e","name":"Count Of Common Divisors","type":1,"slug":"count-of-common-divisors"}}}
plane

Editor


Loading...

Gcd Length

medium

You are given three integers a,b and c. Find two positive integers x and y (x>0 & y>0) such that: 1.the decimal representation of x without leading zeroes consists of "a" digits; 2.the decimal representation of y without leading zeroes consists of "b" digits; 3.the decimal representation of gcd(x,y) without leading zeroes consists of c digits. gcd(x,y) denotes the greatest common divisor (GCD) of integers x and y. Output x and y.

Constraints

1 <= t <= 200 1 <= a,b <= 9 1<= c <= min(a,b)

Format

Input

The first line contains an integer T, number of test cases. The next t lines contain three integers a and b and c.

Output

For each test case print two positive integers x and y.

Example

Sample Input

4 2 3 1 2 2 2 6 6 2 1 1 1

Sample Output

16 243 10 10 163840 196830 1 1

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode