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 | b7ba918ed8a433f2d44451cc22252cff | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class two {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner key=new Scanner(System.in);
int t=key.nextInt();
key.nextLine();
for(int i=0;i<t;i++) {
String str=key.nextLine();
int temp=str.charAt(0)-96;
int temp2=str.charAt(1)... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 6fb41f985e13798c0461cbfff4909062 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class Dictionary_3 {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0) {
String str1 = s.next();
int n = str1.charAt(0);
int t1 = n-96;
int t2 = str1.charAt(1);
if(t2>n) {
t2= t2-1;
}
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 4126f5333236395124207f0d39fe9a67 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 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 final class Solution
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner n1;
try
{... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 3469c4af1b282f8b4775908bc73f61bb | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.util.*;
import java.io.*;
public class Answer {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
HashMap<String, Integer> hm = new HashMap<>();
int c = 1;
for(int i = 1; i <= 26; i++)... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | c9e029cbfd8e93e0e1fc06d5aa70703a | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class CF1209{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int testCases = scan.nextInt();
while(testCases>0){
String string = scan.next();
int index = (string.charAt(0)-'a')*25+1;
if(string.charAt(1)<string.charAt(0)){
inde... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | c9f2c5fcc1ddefdd68b316e14afd9305 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class Dict {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 0; i < t; i++){
String s = sc.next();
int a = s.charAt(0) - 'a' + 1;
int b = s.charAt(1)... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 566b55d059745085e3df316954fe0252 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
// System.out.println(sc.nextByte());
// foodanimal(sc);
dic(sc);
}
private static void dic(Scanner scanner){
int testcase=scanner.nextInt();
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 7e7de0f2f24a0c3f5e638d0d1ae71fba | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
//import java.util.Arrays;
//import java.util.Collections;
//import java.util.ArrayList;
public class CodeForces
{
public static void main(String args[])throws IOException
{
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 1edc52470b3f5bed85cd4ecf588f1faa | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.io.*;
public class practice {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(new BufferedWriter(new PrintWriter(System.out)));
S... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 0889930b108bed057c000a4b08c4805f | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.io.*;
public class Solution{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br=new BufferedReader(new InputStreamReader(System.in));
}
String next(){
while(st==null || !s... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | af7a47de0816f41c71780ff80c356543 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class dictionary {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int testcases = sc.nextInt();
for (int i = 0; i < testcases; i++) {
String s = sc.next();
if(s.... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 5f1c693dbad62ee610eedefa2e3eb53a | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class Solution
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
for(int h=0;h<test;h++)
{
String s = sc.next();
int one = (s.charAt(0)-'a')*25;
int... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 9a81c0abd04a392d7030cc3fc0468315 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class cf {
public static void main(String[] args)
{
HashMap<String,Integer> hm = new HashMap<String ,Integer>();
int count = 1;
for(char i='a';i<='z';i++)
{
for(char j = 'a' ; j<= 'z';j++)
{
if(i!=j)
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | d20b8cea64e4803157dd07665b46f07b | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class Test{
//Global Declarations
final static Random random = new Random();
final static FastReader in = new FastReader();
final static PrintWriter out = new PrintWriter(System.out);
public static int solve() {
//Long rang... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 6ee6c0b359d0250d88ffa8f7a89a87cc | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | /* package whatever; // 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 Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner( Sys... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 5c75c945e83476fe5f313824e38cabff | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.*;
import java.util.*;
public class Main {
static FastScanner sc;
static PrintWriter pw;
public static void main(String[] args) throws Exception{
sc = new FastScanner();
pw = new PrintWriter(System.out);
try{
int T = sc.ni();
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 3d8a332f62cf73b75b15cdc81f0a4ecb | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;
public class One {
static class FastScanner
{
BufferedReader br;
StringTokenizer st;
public... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 2d7bcbe2b5a596480acba9994932844c | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 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){
String s=sc.next();
int a=s.charAt(0);
a =a-96;
int b=s.charAt(1);
b=b-96;... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | c1efbf87dd59fb1efa7c38aa220362e0 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.*;
import java.util.StringTokenizer;
public class B implements Runnable {
public static void main(String[] args) {
new Thread(null, new B(), "whatever", 1 << 26).start();
}
FastScanner s = new FastScanner(System.in);
StringBuilder sb = new StringBuilder();
public voi... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | beb73993687a4c9c0c17a9bcfe420e23 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
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 B_Dictionary{
public static void main (String[] args) throws java.lang.Exception
{
FastReader sc = new FastReader() ;
HashMa... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 86639367a85ac429968e099e0c5a1c54 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
char[] chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 28c4b75de46eb364f1755ea992402695 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.util.Map.Entry;
import java.io.*;
import java.lang.*;
/**
* B_Dictionary
*/
public class B_Dictionary {
private static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedRe... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 6e06e4eaac8fc31a59c6f5f00f89efec | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class dictionary {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int cases = scanner.nextInt();
for (int i = 0; i < cases; i++) {
String word = scanner.next();
char[] letters = new char[2... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | fc1d6e5f62df728056d14c02e62f0b12 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.*;
import java.util.*;
public class roughCodeforces {
public static boolean isok(long x, long h, long k){
long sum = 0;
if(h > k){
long t1 = h - k;
long t = t1 * k;
sum += (k * (k + 1)) / 2;
sum += t - (t1 * (t1 + 1) / 2);
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 7d3e6f46385222bde8d934fcaa4a821c | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWr... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 2eaed95b3f7c03ce90c25a896f92a73d | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.io.*;
// you can compare with output.txt and expected out
public class Round786B {
MyPrintWriter out;
MyScanner in;
final static String IMPOSSIBLE = "IMPOSSIBLE";
final static String POSSIBLE = "POSSIBLE";
final static String YES = "YES";
final static String NO = "NO"... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 304c95591156ba4f1b903d989a7f82ce | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Main {
static Scanner sc = new Scanner (System.in);
public static void main(String[] args) {
int test = sc.nextInt();
for ( int life=0; life<test; life++){
String str = sc.next();
char c1 = str.charAt(0);
char c2 = str.... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | a114c8be43b519ef7966cf19add6675b | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastReader sc = new FastReader();
int t = sc.nextInt();
while(t-->0){
String s = sc.nextLine();
int ans = 0;
ans = (s.charAt(0) - 97)*25;
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | b1a7fbc153d644b520c8129c6fdf7feb | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Scanner;
public class Dictionary_800 {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int cases = Integer.parseInt(input.nextLine());
for (int j = 0; j < cases; j ++) {
String word = input.nextLine();
String[] split1 = word.split(""... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | d454e2e64ebfc00aab77f688be0a1747 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.util.*;
import java.io.*;
public class Main {
static StringBuilder sb;
static dsu dsu;
static long fact[];
static int mod = (int) (1e9 + 7);
static void solve() {
String s=s();
int ch1=s.charAt(0)-'a';
int ch2=s.charAt(1)-'a';
int ans=0;
ans=ch1*25... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 90e8c6f2ef6d6a9ddc9c54ec9ae19276 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException {
// write your code here
r.init(System.in);
int t = r.next... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | b952879a4dc36724449510060207c82d | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.ut... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 2bb69895b28b6fe930d9e42fc49641db | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.util.*;
public class main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int t = cin.nextInt();
Map<String, Integer> dictionary = new HashMap<>();
int count = 0;
for (int i = 0; i < 26; i++) {
for (int k ... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 800c9adcde84ed3cb3fc588082a6ea18 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | // 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 op= new Scanner(System.in);
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 6b7b8dc8efbf7cb1b8825c2f5edb8978 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Main{
static int N = 1010;
static int[][] c = new int[N][N];
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
int cnt = 0;
for (char i = 'a' ; i <= 'z' ; i ++ )
for (ch... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 4accbd2e66ecb0c0d4494849e682cf07 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
public class Watermelon4A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
HashMap<String, Integer> map = new HashMap<>();
int count = 1;
for (char ch = 'a'; ch <= ... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | b4b5ce4d62e7d38c409bb1e6b819f0eb | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int count = Integer.parseInt(scanner.nextLine());
Map<String, Integer> map = new HashMap<>();
int cur = 1;
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 7e9ac06399217534f7be0b052e259022 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
char i,j;
HashMap<String,Integer> map=new HashMap<>();
int c=0;
for(i='a';i<='z';i++)
{
for(j='a';j<='z';j++)
{
if(i!=... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 02fc21e0cfc67b7ee8b331073b95ae18 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.*;
import java.util.*;
/**
* @author atulanand
*/
public class Solution {
private static int solve(char[] arr) {
int f = (int) arr[0] - 97;
int s = (int) arr[1] - 97;
return (f) * 25 + s + (s < f ? 1 : 0);
}
public static void main(String[] args) throws IOException {
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | cd964ea377538aebdfd6459770da98ad | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int kol =sc.nextInt();
for(int a =0;a<kol;a++){
String s =sc.next();
char ch = s.charAt(0);
char ch2 =s.charAt(1);
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | d78ecfcb93d3726ec76a213c41d739f0 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
public class Lol {
//Hi my name is Vijay, My age is 27, My birthday is 17th Oct 1995.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//System.out.println('c'-'a');
int t = sc.nextInt();
while (t-- > 0) {
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 46315ac10bef9200a2c5a4015e0f42d1 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.util.*;
import java.util.stream.*;
public class Sequence {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
scan.nextLine();
StringBuilder result = new StringBuilder();
for(int i = 0; i < t; i++) {
String s = scan.nextLine();
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | e51bffc9c94968df341415da75b1f364 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | // package All_in_all;
import java.io.*;
import java.util.*;
/**
* Created by nikitos on 23.08.17.
*/
public class A {
public StreamTokenizer t;
public int nextInt() throws IOException {
t.nextToken();
return (int) t.nval;
}
public long nextLong() throws IOExcep... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | eee7140fde8e532960f0d012be097fc4 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 98cdfdfc459b327e387cf052dacab418 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.util.*;
import java.io.*;
public class Main {
static int n, m, x, y, test, N = 200001;
static String io[], s;
public static void main(String[] args) throws Exception {
test = Integer.parseInt(in.readLine());
while (test-- > 0){
s = in.readLine();
... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 46e399044b8d8a73afc3b82ff4393c0d | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes | import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.security.cert.X509CRL;
import java.util.*;
import java.lang.*;
import java.util.stream.Collector;
import java.util.stream.Co... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 5ba689c7830b708c43073176702109f8 | train_107.jsonl | 1651502100 | The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic... | 512 megabytes |
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class cf1674B {
// https://codeforces.com/contest/1674/pro... | Java | ["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"] | 2 seconds | ["1\n2\n25\n26\n27\n649\n650"] | null | Java 11 | standard input | [
"combinatorics",
"math"
] | 2e3006d663a3c7ad3781aba1e37be3ca | The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language). | 800 | For each test case, print one integer — the index of the word $$$s$$$ in the dictionary. | standard output | |
PASSED | 6ab3e55aa1631ae9189d658caab18351 | 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 {
private static class Task {
public void solve(int testNumber, InputReader in, PrintWriter out) {
int a = in.nextInt();
int b = in.nextInt();
if (b < a || b % a != 0) {
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 17 | 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 | fdce2c5844b51d632a539c3cd2e6cbeb | 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.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
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 17 | 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 | 7c7691186cff72f5829afcc7194cf6b1 | 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 forces2 {
public static void main(String[] args)
{
Scanner sc =new Scanner(System.in);
int t = sc.nextInt();
while(t-->0)
{
// int n= sc.nextInt();
String s;
s = sc.next();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | ad1b279c6222da2583c94c25296c6cab | 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 int hcf(int n1, int n2){
if(n2 != 0){
return hcf(n2, n1%n2);
}else{
return n1;
}
}
public static void main(String args[]) {
Scanner sc= new Scanner(System.in);
int ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 144b53035a4aa0ad011a1ceb087206bf | 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 myobj=new Scanner(System.in);
int t;
t=myobj.nextInt();
int i,j,k;
int c[][]=new int[2][t];
for(i=0;i<t;i++)
{
int x,y;
x=myobj.nextInt();
y=myobj.nextInt();
k=y/x;
int a,... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 7508f647bcc2c531d4dcd62cca0901d1 | 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 Testing {
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(),y=s.nextInt();
if (x>y||((double)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 17 | 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 | 94ef8aeabf3a769f0bc2587e79d49968 | 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 x,y;
x=sc.nextInt();
... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | df1ffcb7d26e425c6cb497432d54c2f8 | 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.sameer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner fs=new FastScanner();
PrintWriter out=new ... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 44c8ca68b89a6884f5aadd1159758b80 | 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 problem2 {
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.o... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | f98bc7290e2a44ea930c39daa4c68a2b | 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 s=new Scanner(System.in);
int n=s.nextInt();
s.nextLine();
while(n!=0)
{
--n;
int x=s.nextInt();
int y=s.nextInt();
if(y... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 0a3e2bb70c54455917181d293bdce17f | 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 s=new Scanner(System.in);
int n=s.nextInt();
s.nextLine();
while(n!=0)
{
--n;
int x=s.nextInt();
int y=s.nextInt();
if(y... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 8a9ff7d8622604faa048f4d8fa5bf471 | 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.Scanner;
public class CF1674A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8);
int t = scanner.nextInt();
for (int i = 0; i < t; i++) {
int x = scanner.... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | b9084e8c73da9240e53ef7b2a841a265 | 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 lta = new Scanner(System.in);
int t = lta.nextInt();
while (t -->0){
int x = lta.nextInt();
int y = lta.nextInt();
int count = 0;
if... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 76a43116d0dbb32ab44905d8240f798f | 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_Number_Transformation {
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 (y % x != 0) {
System... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 679b2b05a3f499249b66ec8e9c22622a | 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.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Solution {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static PrintWriter pw = new PrintWriter(System.out);
static v... | Java | ["3\n\n3 75\n\n100 100\n\n42 13"] | 2 seconds | ["2 5\n3 1\n0 0"] | null | Java 17 | 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 | 8b56847e1685666320c6e3dd12b06602 | 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 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.println("0 0");
}els... | 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 | a2aedf0508a22832e3b440c5c4644a03 | 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));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
int t = Integer.valueOf(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 | b8025d099c08ddf1d0215e3ea5c684bf | 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 int gcd(int a,int b){
return b != 0 ? gcd(b, a % b) : a;
}
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
while (T -- > 0){
int x = 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 | bef73ce498a4867fdd3dd3f9f1796575 | 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.awt.datatransfer.StringSelection;
import java.util.*;
import javax.management.Query;
import java.io.*;
public class practice {
static String s;
static int n,k;
static int[] a;
static long[][] memo;
static HashMap<Long,Integer>hm;
public static void main(String[] args) ... | 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 | 90d3b110afc49e5e4e84376c3bc782f9 | 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.InputStreamReader;
import java.util.Scanner;
/**
* NumberTransformation_1674A
*/
public class NumberTransformation_1674A {
private static int m;
private static int n;
public static void main(String[] args) throws Exception {
BufferedReader br = new... | 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 | 2f5a7cf0f6ec07fe6936a7f0adc7b703 | 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 ary{
static Scanner sc = new Scanner(System.in);
public static void main(String[] args){
int tt = sc.nextInt();
for(int i = 0;i < tt; i++){
callme();
}
}
public static void callme(){
int x = sc.nextInt();
int y = sc.nextInt();
if(x == 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 | 98dfceba476f05e6aa564d80f501691f | 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.security.spec.RSAOtherPrimeInfo;
import java.util.*;
import java.lang.*;
public class solve {
static Scanner sc;
public static void main (String[] args) {
sc = new Scanner(System.in);
// testCases
int testCases = sc.nextInt(); // scan first-word
while (testCases > 0) {
jus... | 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 | e886a8da593bcc90b4f0c289a7c56bb8 | 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.security.spec.RSAOtherPrimeInfo;
import java.util.*;
import java.lang.*;
public class solve {
static Scanner sc;
public static void main (String[] args) {
sc = new Scanner(System.in);
// testCases
int testCases = sc.nextInt(); // scan first-word
while (testCases > 0) {
jus... | 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 | 8915b12649aac106a379fe6883649e9a | 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.*;
public class solve {
static Scanner sc;
public static void main (String[] args) {
sc = new Scanner(System.in);
// testCases
int testCases = sc.nextInt(); // scan first-word
while (testCases > 0) {
justDoIt();
testCases--;
}
}
// ==... | 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 | 7bcc5581c8f284e8cc88dcca64f01e51 | 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 whatever //do not write package name here */
import java.io.*;
import java.util.*;
public class GFG {
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 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 | fa2b339612df1ed064cf1f2bc94fb8bd | 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 static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;
/**
*
* @Har_Har_Mahadev
*/
/**
* Main , Solution , Remove Public
*/
public class A {
public static void process() throws IOExcepti... | 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 | a18feaa479a473e36425309103ac6c6b | 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)
{
int x=sc.nextInt();
int y=sc.nextInt();
if(x>y || 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 | ed20ffba0d27a6c6610a170c01e5cf42 | 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_786 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
A_786 ob=new A_786();
int t=sc.nextInt();
StringBuilder ans=new StringBuilder();
while(t-->0)
{
int x=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 | c952c5ccff9a8e778d7f811e3394fa62 | 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 | 7a142756d090a7b120d67b936850f1d2 | 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)
{
int x=sc.nextInt();
int y=sc.nextInt();
if(x>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 | 4ac42fc987d81f0f8ba7290cace96200 | 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.*;
import java.math.*;
public class Contest786A{
public static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new 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 | 3a0414159316daafc8d1a14fe15ea79f | 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 int list[] ={0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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 | b3f99d9487b8f472ba7fe030b832105c | 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 input = new Scanner(System.in);
long t = input.nextLong();
long a = 1;
long b = 0;
for (long i = 1; i <= t; ++i) {
long x = input.nextLong();
long y = input.nextLong();
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 | bf154731162f3c12f44729e262b096aa | 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 a = sc.nextInt();
int b = sc.nextInt();
if(b%a==0){
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 | 8efb7c3841a84f7053880742afa65b49 | 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 | //javac CF786_1.java; java CF786_1
import java.util.*;
public final class CF786_1 {
public static void main (String[] args) {
Scanner in = new Scanner(System.in);
int tnr = in.nextInt();
for (int t = 0; t < tnr; t++) {
long x = in.nextLong();
... | 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 | 54f8864c66a69dcadc00217b706244dd | 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;
import java.io.*;
import java.util.StringTokenizer;
public class A_1674 {
static void solve(FastReader sc) {
int a = sc.nextInt();
int b = sc.nextInt();
if (a > b) {
System.out.println("0 0");
} else {
if (b % a != 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 | 787ba209e4386f33b7fdd93c5535903e | 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 sc = new Scanner(Syst... | 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 | fd21f21d0be87eceba22b1f57cf441ac | 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 solution(int x,int y)
{
int a=0;
int b=0;
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 | 001a13b3d9aa73e8e0669aeb496d0131 | 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) {
try(Scanner scanner = new Scanner(System.in)) {
int t = Integer.parseInt(scanner.nextLine());
for (; t > 0; t--) {
String[] line = scanner.nextLine().split(" ");
... | 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 | 3272172d8476c17eff25cf7eba4cd3bf | 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 Ques1 {
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();
if(x!=0 && y%x==0) System.out.println(1+" "+(y/x));
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 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 | 2b03635060371a8e4b4bbc284122648e | 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 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter out = new PrintWriter(System.out);
static StringTokenizer st = new StringTokenizer("");
static String next() throws IOException {
... | 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 | 9c3a9973e131cce22df3834504c98247 | 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.prin... | 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 | f7f0da7fc29761938e5fef5b9096aeae | 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 class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
... | 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 | a89a11b3890563b1e3129179fb5e713b | 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.Arrays;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tc = sc.nextInt();
for (int itc=0; itc<tc; itc++) {
int x = sc.nextInt();
int y = sc.nextInt();
if (y % x != 0) {
System.out.printl... | 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 | eec89e66f37985f236e857003e74cdbf | 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.Arrays;
import java.util.Scanner;
public class Demo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tc = sc.nextInt();
for (int itc=0; itc<tc; itc++) {
boolean flag = true;
int x = sc.nextInt();
int y = sc.nextInt();
double a = 1.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 | d8bc71d431aa036758082ff404377be3 | 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 = 0;
int b = 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 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 | 5a9604fe85204a2e57e990b440fba046 | 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 ACM {
private static int[][][] table = new int[101][101][2];
public static void main(String args[]) {
computeTable();
Scanner in = new Scanner(System.in);
for (int t = in.nextInt(); t > 0; t--) {
int x = in.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 | 26c69cd8cf5f3b26b15ebd5981669f2d | 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 sc = new Scanner(System.in);
int num = sc.nextInt();
sc.nextLine();
for (int i = 0; i < num; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
if (y < x || y%x!=0) {
System.out... | 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 | 3ddceaa22f1495e6d2a9380931610ecd | 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.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main{
static int mod = (int)1e9+7;
static PrintWriter out;
static int[] memo;
sta... | 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 | 187301f9854aade0ceda0fab812a5dd3 | 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 Scanner cin;
public static int[] sieve = new int[101];
public static void main(String[] args) {
cin = new Scanner(System.in);
int t = 1;
t = cin.nextInt();
while (t-- > 0) {
solve();
... | 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 | e08e7b2b473365297c416236e4d25599 | 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 tt=1;tt<=t;tt++) {
int a=sc.nextInt(), b=sc.nextInt();
if(b%a!=0) System.out.println("0 0");
else Syst... | 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 | 747f51da3f2634d34f892c3d2b8a4664 | 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 | /**
* @Jai_Bajrang_Bali
* @Har_Har_Mahadev
*/
//@Author : Sanat04
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class practice2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while... | 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 | eaf8cb14776d757ead980df8a76bbf5d | 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 long d;
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
while (t-- > 0) {
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.