exec_outcome stringclasses 1
value | code_uid stringlengths 32 32 | file_name stringclasses 111
values | prob_desc_created_at stringlengths 10 10 | prob_desc_description stringlengths 63 3.8k | prob_desc_memory_limit stringclasses 18
values | source_code stringlengths 117 65.5k | lang_cluster stringclasses 1
value | prob_desc_sample_inputs stringlengths 2 802 | prob_desc_time_limit stringclasses 27
values | prob_desc_sample_outputs stringlengths 2 796 | prob_desc_notes stringlengths 4 3k ⌀ | lang stringclasses 5
values | prob_desc_input_from stringclasses 3
values | tags listlengths 0 11 | src_uid stringlengths 32 32 | prob_desc_input_spec stringlengths 28 2.37k ⌀ | difficulty int64 -1 3.5k ⌀ | prob_desc_output_spec stringlengths 17 1.47k ⌀ | prob_desc_output_to stringclasses 3
values | hidden_unit_tests stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PASSED | e5b465ad29502d7c8679e35a4f475e15 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class NumberTransformation {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x==0){
System.out.pr... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 893f0211c702f578f894e8d37b17317d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int x=sc.nextInt();
int y=sc.nextInt();
if(y%x==0)
System.out.println(1+" "+y/x);
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | a2cf57f9222e977aaf32f4bc5c1c7aa2 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
public class Main {
static int mod = 1000_000_007;
static long mod1 = 998244353;
static boolean memory = true;
static FastScanner f;
static PrintWriter pw;
static double eps = 1e-6;
static int oo = (int) 1e9;
static boolean fileIO = false... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 40c58163948659518325fb9892960348 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while (t-- > 0) {
int x = in.nextInt(), y = in.nextInt();
if (y % x != 0) {
System.out.println("0 0");... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | fd2afa427648647e551672955ac03a4e | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
// 1 2 2 --6
// 2 3 3 -- 5
public class D {
private static void sport(int x, int y) {
if (y % x != 0) {
System.out.println("0 0");
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 293998331e884cabe336648cc5993759 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner in= new Scanner(System.in);
int t=in.nextInt();
while(t-->0){
int x=in.nextInt(),y=in.nextInt();
int d=y/x;
if(d*x==y){
System.out.println(1+"... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 13fd2e40e319dd1aa391def941324ab3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.*;
import java.text.DecimalFormat;
public class Solution {
public static void main(String[] args) throws Exception{
Scanner s = new Scanner(System.in);
int count = s.nextInt();
for(int i=0;i<count;i++){
int x = s.nextInt();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f7dee5b1995cfd1edcfbd163f916ae57 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class A {
public static void main(String[] args) throws IOException {
BufferedReader io = new BufferedReader(new InputStreamReader(System.in));
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | ce522ca589a5c4f6c5e36fe7c0b6b8f8 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class CodeForces {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0) {
int x = s.nextInt(), y = s.nextInt();
if (y % x == 0) {
System.out.p... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 4cc092d8500925686d8e25a911c16514 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class divka {
public static void main(String[] args) {
Scanner css = new Scanner(System.in);
int t = css.nextInt();
int a = 0, b = 0;
for (int i = 0; i < t; i++) {
int x = css.nextInt(), y = css.nextInt();
if (y >= x && y % x... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 1890efc931dedbbbca141a3d7c091d12 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
public class A_Number_Transformation {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
int t = sc.nextInt();
while (t-- > 0) {
int x = sc.nextInt(), y = sc.nextInt();
if ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 7fd831f5b863e323f47ebcfc0831ddf3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class A {
static FastScanner sc;
static PrintWriter pw;
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in), 32768... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 24554d47237c06f7e30c4154d75eeb1d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
/*
!!!!Hello World,Prakhar here!!!!
codechef handle prakhar_3011
codeforces handle prakhar_30
trying to get good at CP
PEACE OUT.........
*/
/*
*/
import java.io.*;
import java.util.*;
public class A {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 4c57df79dfad2ec27678ff3e3cd47504 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Solution {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
while(t-->0) {
int x = scan.nextInt();
int y = scan.nextInt();
if(y%x != 0)
System.out.println("0 0");
else
System.out.print... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | cd500fd3d8aaeebbd58389f4a6334439 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
final Scanner scanner = new Scanner(System.in);
int t=scanner.nextInt();
while (t--!=0){
int x=scanner.nextInt(),y=scanner.nextInt();
if (y%x!=0){
System.out.print... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 3e962abf1e9bd8dbe30ef9a7a012f3d3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
final Scanner scanner = new Scanner(System.in);
int t=scanner.nextInt();
while (t--!=0){
int x=scanner.nextInt(),y=scanner.nextInt();
if (y%x!=0){
System.out.print... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 53614f06440c81a5a7cf46b15a4bf345 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(new BufferedInputStream(System.in));
int t = in.nextInt();
for (int i = 0; i < t; i++) {
int x = in.nextInt(), y = in.nextInt();
if (... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 58cd71564247312b8cb9582502a651a3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
int x=sc.nextInt();
int y=sc.nextInt(... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 1118c27ca848a31bc4116de8d811cd8b | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
public class Solution{
public static void main(String[] args) throws IOException
{
FastScanner f= new FastScanner();
int ttt=1;
ttt=f.nextInt();
PrintWriter out=new PrintWriter(System.out);
outer: for(int tt=0;tt<ttt;tt++) {
int x=f.nextInt();
int y=... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 7d7ae3431fd48fdd9dd708521abba985 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Transformation1 {
public static void main(String args[]){
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
while(n-->0){
int a, b = 0, c = 0;
int x = scanner.nextInt();
int y = scanner.ne... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 1d4e94118f45f2e2b6cabf1c7428a782 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Main {
public Main() {
FastScanner input = new FastScanner(System.in);
StringBuild... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 38b56fe010630d78c099d89fd217ee2e | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | //package com.company;
import java.util.*;
import java.io.*;
public class NumberTransformation {
private static int[] solve(int x, int y) {
int[] ans = new int[2];
if(y % x != 0) return ans;
int n = y/x;
ans[0] = 1; ans[1] = n;
return ans;
}
public static void main... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | cafa866b05dc4fca01f77863889dabf2 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Solution {
static List<List<Integer>> ans;
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
// div 3;
int t=sc.nextInt();
while (t>0){
t--;
int x=sc.nextInt();
int y=sc.nex... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 8e5ca8f785c12fe9bf6406e5d37ad28c | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | //import java.io.IOException;
import java.io.*;
import java.util.*;
import java.util.function.LongToIntFunction;
public class Template {
static InputReader inputReader=new InputReader(System.in);
static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 728d0b8822520b2053e6e3e8218eb145 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class NumberTransformation {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int n = sc.nextInt();
while (n-- > 0) {
int x = sc.nextInt();
int y = sc.nextInt();
if (y % x != 0) {
System.out.println("0 0");
}e... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 73efa8e85c41f86028567dc3ca684c49 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class NumberTransformation {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-- >0){
int x = s.nextInt();
int y = s.nextInt();
double rat = (double)y/x;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | b4e6d15b4f8ffb4065edb2455eb6ee12 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int a,b;
for(int i=0;i<t;i++){
int x=sc.nextInt();
int y=sc.nextInt();
if(y%x==0){
b=y/x;
a=1;
}
else{
a... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 2f3ad8ccaea7269b6135dbee1e6a5651 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class k {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
PrintWriter o = new PrintWriter(System.out);
long t = sc.nextLong();
boolean h = false;
while (t-->0) {
h = false;
long x = ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 790e8b7dde1209103e746573b3db1ca7 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | // package Round786DIV3;
import java.io.*;
import java.util.StringTokenizer;
public class A {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
while(t-->0... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 093d36fe0c8511ad486a1877cf0b7041 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Priorit... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 03bae7fe7a1ff8963107a89b0dd92c4a | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import static java.lang.System.currentTimeMillis;
/*
* @author: Hivilsm
* @createTime: 2022-04-27, 23:29:16
* @description: Platform
*/
public class Accepted... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | b2db2f4ffaf62eb2f464fc6622387b6a | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
for(int i=0; i<t; i++) {
int x = s.nextInt();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | eb1b8312d28fba5e4843607cd0858773 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.getProperty;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | e44eddfb7bf758de432fa05ee88702e3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class number{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x!=0)
System.out.println(0+" "+0... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f7ce91c6e2a017aaa611bedc690c5739 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class MyClass{
public static void main(String[] args){
Scanner scr= new Scanner(System.in);
int t=scr.nextInt();
scr.nextLine();
while(t-->0){
int x=scr.nextInt();
int y=scr.nextInt();
if(y%x!=0){
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | cb2fde55e6056a43a68ccd6a33cfcb8b | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class lab_1 {
public static void main(String[] args) throws IOException{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 0;i<t;i++)
{
int x = sc.nextInt();
int y = sc.nextInt();
int a= 0;
int b = 0;
if(y% x ==... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f67a69546236cc2da300e69954dc41ce | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Solve {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String numberOfTestCasesString = input.nextLine();
int numberOfTestCases = Integer.parseInt(numberOfTestCasesString);
int x,y;
while (numberOfTestCases-- > 0) {
x = i... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 6a87dcc99eb47eeaef227cca35038078 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class codeforcesdiv3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
scan.nextLine();
for(int i = 0; i < n; i++){
int x = scan.nextInt();
int y = scan.nextInt(... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 6ad74b61b797f428d587718530881aa3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import s... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f19b72dc0fe33b2adb497022d1af68f4 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code h
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i <t; i++) {
int a = s... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 8e936556e7c521a4fdecf1d65df614e0 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class NumberTransformation
{
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
pr... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | cac5aebad0316d68affaa64f0bc49137 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | // Working program using Reader Class
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Scanner;
import java.util.StringTokenizer;
//====== ++++++++ +++++++ |\ /| |+++ | ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 37892fc4d8991d8d95042814235059c1 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int w=sc.nextInt();
while (w-->0){
int x=sc.nextInt(),y=sc.nextInt();
if(y<x||y%x!=0){
System.out.println(0+" "+0);
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 6e618c0cc7e05095a63ba702ceeeba96 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class A {
static Scanner sc = new Scanner(System.in);
public static void solve(){
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x==0){
System.out.println(1+" "+(y/x));
}else{
System.out.pri... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | fb3a1a0ec975d8e0e457e071cdc5a6f4 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.*;
import java.util.*;
public class Solve {
static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
static int Int() throws IOException {
in.nextToken();
return... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 156ea358ff9bd5003488831698d1d3db | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
// cd C:\Users\Lenovo\Desktop\New
//ArrayList<Integer> a=new ArrayList<>();
//List<Integer> lis=new ArrayList<>();
//StringBuilder ans = new StringBuilder();
//HashMap<Integer,Integer> map=new HashMap<>();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 76ace31773f4a4bedc5238d8491e6ef1 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
import java.util.Arrays;
public class vanita {
public static void main(String[] args){
Scanner in =new Scanner(System.in);
int cases = in.nextInt();
double answer;
int multiplier;
for (int i = 0; i < cases;i++){
int x = in.nextIn... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | d9835b24b397dd6d9a9439b7c9b82995 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
public class solution{
public static void main (String[] args) {
int t=sc.nextInt();
while(t--!=0)
{ int a=sc.nextInt();
int b=sc.nextInt();
if(b%a!=0) {
out.println(0+" "+0);
}else {
out.println(1+" "+b/a)... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 86b7cfa48a80deb82ed684956393a61c | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
/*
* Author: Atuer
*/
public class Main
{
// ==== Solve Code ====//
static int INF = 2000000010;
public static void csh()
{
}
public static void main(String[] args) throws IOException
{
// csh();
int t = in.nextInt();
while (t-- > 0)
{
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 4b4f1a2d5331a2d6cba143eae07585ba | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class A_Number_Transformation {
static Scanner in = new Scanner();
static PrintWriter out = new PrintWriter(System.out);
static ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 4288e278bf27ff05eabe0898d76a1b60 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class NumberTransformation {
public static void main(String args[]) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(reader.readL... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 497b21e2acb1d917cc277386560a82e2 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Number{
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int t = Integer.parseInt(br.readLine());
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | ab6e6c448580543106322903d4cd84c4 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int test=s.nextInt();
while(test-->0)
{
int a=s.nextInt();
int b=s.nextInt();
if(a>b)
{
System.out.println("0... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 970b313aa883e54c6f68706c6987b7fd | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.Math;
import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.util.StringTokenizer;
public class Main {
static class FastReader {
BufferedReader br;
StringTokeni... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | fd5f9c5738edbaec273ac327e51a1b6d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
public class test{
public static void main(String []args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int x=sc.nextInt();
int y=sc.nextInt();
if(y%x!=0){
System.out.println(0+" "+0);
}
else{
System.out.println(1+"... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 6def9fab189707c03f9b4e54e10dbd63 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int TT = sc.nextInt();
for(int tt=0; tt<TT;tt++){
int x = sc.nextInt();
int y = sc.nextInt();
if(!(y%x==0 )){
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | b02ecda1b65f14e57d67c8c94dfdbc21 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while (t-->0){
int a=sc.nextInt();
int b=sc.nextInt();
if (b%a!=0){
System.out.println(... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 1c0c71d980841ad9d7a8f783d5831292 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | // package faltu;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.Map.Entry;
public class Main {
public static int upperBound(long[] arr, long m, int l, int r) {
while(l<=r) {
int mid=(l+r)/2;
if(arr[mi... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 7f81a0f4f4bc829aabae3041970ee1aa | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan = new Scanner(Sy... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 3602bc9e67591d43612b89e7028622ba | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class proj {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int x,y;
for(int i=0; i<t; i++) {
x = sc.nextInt();
y = sc.nextInt();
if(x==0 && y==0) Syste... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | ac8d1fc1acb3707600404cd4491b59cd | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class A {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 46e1a44139cf3750d7a2715c2b6c1446 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Codeforces {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(
new InputStreamReader(System.in));
}
String next... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 8409032c6949460606c3a00cbc549378 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Main{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
try {br = new BufferedReader(
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 578ad6917d6a7233d6db4d853daa1165 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
import javafx.scene.control.Label;
public class A_Number_Transformation{
static Scanner sc = new Scanner(System.in);
// @Harshit Maurya
public static void reverse(int[] arr, int l, int r) {
int d = (r - l + 1) / 2;
for (int i = 0; i < d; i++) {
int t = arr[l + i];
a... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 25ffab79ee0667240a079c6a80d7c34f | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args){
int t = sc.nextInt();
while(t-- > 0){
int x = sc.nextInt(); int y = sc.nextInt();
boolean flag = false;
int a=0,b=0;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | a660b0f2fed349921d522c487dfac2f0 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef {
static FastReader in=new FastReader();
static final Random random=new Random();
static long mod=1000000007L;
static long[] fact = new long[16];
static void init() {
fact[0] = 1;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 8 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | a7a8a7c2466d29dff08fa643dca34f0b | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class TrialCodes {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0) {
int x = sc.nextInt(), y = sc.nextInt();
if(x > y) {
System.out.println(0+" "+0);
cont... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 109430292beac3c08090be979222610f | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
// CodeForce: Number Transformation
public class NumberTransformation {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 5ef996a89429b587e915a42297f5a02a | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.lang.Math;
public class main{
public static void main(String[]args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int x=sc.nextInt();
int y=sc.nextInt();
int a=0;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | ee293f4e7ea47aeec511768154ec2cbb | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Sov
{
public static void main(String args[])
{
long t;int n,m;
Scanner x=new Scanner(System.in);
t=x.nextLong();
while(t>0)
{
t--;
n=x.nextInt();
m=x.nextInt();
if(m%n==0)
System.out.println("1"+" "+m/n);
else
System.out.println("0"+" "+"0");
}}} | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 36677e50760adc9a2bf6730e336d0a33 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.*;
import javax.management.openmbean.OpenDataException;
public class Codeforces {
final static int mod = 1000000007;
final static String yes = "YES";
final static String no = "NO";
public static void main(String[] args) throws Exception {
FastRead... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f5411274ae92e7929ae8881dd7ba008f | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | // y = (b ^ a) * x
// a = log_b y/x, b = (y/x) ^ (1/a)
import java.util.Scanner;
/**
* numberTransformation
*/
public class numberTransformation {
public static int[] findAB(int x, int y) {
int a;
float calc;
int[] out = {0, 0};
if (y % x == 0) {
if (... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 9bad7d3b549241bf686a975dc50ebc5e | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Practice {
static boolean multipleTC = true;
final static int mod2 = 1000000007;
final static int mod = 998244353;
final double E = 2.7182818284590452354;
final double PI = 3.14159265358979323846;
int MAX = 1005;
boolean sieve[];
int pf[];
ArrayList<Intege... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 407d1988400f1bcd225e1025f438e463 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class NumberTransformation {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while(T-- >0) {
int x = sc.nextInt();
int y = sc.nextInt();
if(x>y || y%x !=0 ) {
System.out.p... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | a6d587d41eacd39e03791b1946f170bb | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main{
public static boolean isInt(String str) {
String s1="0.0";
if(s1.equals(str)){
return true;
}
try {
@SuppressWarnings("unused")
int x = Integer.parseInt(str);
return tru... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 1d43e6500498d693eefc74f894f365f0 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
int x = sc.nextInt();
int y = sc.nextInt();
int b=0;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 31df234dc6566278b58c0dda715b1cc1 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class claas{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int x=sc.nextInt();
int y=sc.nextInt();
if(x>y) {
System.out.println("0"+" 0");
}
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 88518b2f646dc9c23d2d1e93c9cc41ee | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
for (int i = 0; i < count; i++) {
int[] ints = new int[2];
fillArray(ints, sc);
int x = ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 73588e697b94b66ed44da101734d0b9c | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int iter=1;iter<=t;iter++)
{
int x=sc.nextInt(),y=sc.nextInt();
if(y<x||(y*1.0)/x - (y/x) != 0)
System.out.println("0 0");
else
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | c71be6dad7016625900c9e2d53c79649 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int trials = sc.nextInt();
while (trials > 0){
int x = sc.nextInt();
int y = sc.nextInt();
int a = 0;
int b = 0;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | d66d6b8805d21b9c4be572e2b115616e | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class A
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0)
{
int x=sc.nextInt();
int y=sc.nextInt();
int c=1;
if(x>y ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 33b6912d2070224e300680818383cd66 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x, y;
long t;
t = scan.nextLong();
while (t > 0){
x = scan.nextInt();
y = scan.nextInt();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | b1c88e7bfb62553941461e5b970faacc | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class a {
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in);
int t =sc.nextInt();
while(t--!=0)
{
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x!=0)
System.out.println(0 +" "+0);
else
System.out.println(1... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 9079b6460e93dcaa782f4347fcb64e03 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.nio.charset.StandardCharsets;
import java.util.*;
import java.io.*;
public class test {
public static long gcd(long a, long b){
if (b == 0)
return a;
return gcd(b, a % b);
}
public static void main(String[] args) throws IOException{
Scanner sc ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 39273b54b3d2914ea7b14337c5d03a2d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Sov
{
public static void main(String args[])
{
long t;int n,m;
Scanner x=new Scanner(System.in);
t=x.nextLong();
while(t>0)
{
t--;
n=x.nextInt();
m=x.nextInt();
if(m%n==0)
System.out.println("1"+" "+m/n);
else
System.out.println("0"+" "+"0");
}}} | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | b179904cc39318080d88aa50016b1e43 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputM... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 39a3fdc9ac63dc4b0513d65ac074d46d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class NumTransform {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for(int i=0; i<n;i++){
int x = sc.nextInt();
int y = sc.nextInt();
factors(x,y);
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 08011ce5f47ea1b620acc00d241dc81f | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | // Online Java Compiler
// Use this editor to write, compile and run your Java code online
import java.util.*;
import java.lang.*;
public class HelloWorld {
public static void solution(int x, int y){
int a=0,b=0;
if(y<x){
System.out.println(a+" "+b);
return;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f34fcbd2e65a701b1908d2406a0586fc | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class q52 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
int x= sc.nextInt();
int y= sc.nextInt();
solve(x,y);
// System.out.println(ans... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 5f69272c338dc49af4b93ca236223ef3 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
import java.io.*;
public class Solution{
public static void main(String args[]) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while(t-->0){
String arr[] = br.readLine... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 99000d358dc966c3868d2eea8bbc6901 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- != 0) {
long x = sc.nextLong();
long y = sc.nextLong();
if(y%x==0)
Sys... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 7d7a2cc3fa00984631f78a64c30eb66d | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class hello {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t;
t = sc.nextInt();
while(t-- >0) {
int x,y;
x = sc.nextInt();
y = sc.nextInt();
if(y%x != 0) {
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 2480bd4fc9c34934f80ae2e36905cd8c | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int n=in.nextInt();
while (n-- > 0) {
int x=in.nextInt();
int y=in.nextInt();
if(y%x==0){
int a=y/x;
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 2087ba1e77c498a6564eacd3dd07d941 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamRe... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f6c3586d7bc13140e36eb2196f38d517 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | //import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//import java.util.Arrays;
//import java.util.HashMap;
//import java.util.Map;
//import java.util.Random;
import java.util.Scanner;
//import java.util.StringTokenizer;
public class Solution {
public static... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 28996482653c5e262bed14683f90e45c | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Solution {
ArrayList<String> l = new ArrayList<String>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
outer : while (t-- > 0) {
int a = sc.nextInt();
i... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 704f556b30715f944b5190a349c074d5 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main{
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for(int i=0;i<n;i++){
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x!=0){ System.out.println("0 0");}else{
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | f0272657761929ae2b89610a3d301877 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
while(t-- > 0){
int x = scn.nextInt();
int y = scn.nextInt();
if(y % x == 0){
System.out.println("1 " + y / x);
}else{... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | 13e2172ef1057f0a45724216c507a203 | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes |
import java.util.*;
public class A{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0)
{
int x = sc.nextInt();
int y = sc.nextInt();
if(y%x == 0) {
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output | |
PASSED | a292e5cb0e4608e7d59461053da0e35a | train_107.jsonl | 1651502100 | You are given two integers $$$x$$$ and $$$y$$$. You want to choose two strictly positive (greater than zero) integers $$$a$$$ and $$$b$$$, and then apply the following operation to $$$x$$$ exactly $$$a$$$ times: replace $$$x$$$ with $$$b \cdot x$$$.You want to find two positive integers $$$a$$$ and $$$b$$$ such that $$... | 512 megabytes | //package codeforces.contest;
import java.util.*;
public class A{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0)
{
int x = sc.nextInt();
int y = sc.nextInt();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 11 | standard input | [
"constructive algorithms",
"math"
] | f7defb09175c842de490aa13a4f5a0c9 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Each test case consists of one line containing two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 100$$$). | 800 | If it is possible to choose a pair of positive integers $$$a$$$ and $$$b$$$ so that $$$x$$$ becomes $$$y$$$ after the aforementioned process, print these two integers. The integers you print should be not less than $$$1$$$ and not greater than $$$10^9$$$ (it can be shown that if the answer exists, there is a pair of in... | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.