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
b591ecfa4781512baa76fe96e2d35ad9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Random; import java.util.StringTokenizer; public class ns...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n< 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ca3ab61230d8e1e395f2db94610a7094
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigInteger; public class Main { InputStream is; PrintWriter out = new PrintWriter(System.out); ; String INPUT = ""; void run() throws Exception { is = System.in; solve(); out.flush(); o...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n< 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
296a5639c7cc6f6e8d6d1105d16aa3ec
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Solving { public static void main(String[] args) { Scanner moad=new Scanner(System.in); int t; t=moad.nextInt(); while(t>0) { long n,s,c; n=moad.nextLong(); s=moad.nextLong(); c=s/(n*n); if(c>n+1) System.out.println(s/(n-1)); else ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n< 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
2979851f73a081522104c5c31e021353
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Space { public static void main(String[] args) { Scanner moad=new Scanner(System.in); int t; t=moad.nextInt(); while(t>0) { long n,s,c; n=moad.nextLong(); s=moad.nextLong(); c=s/(n*n); if(c>n+1) System.out.println(s/(n-1)); else ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n< 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
57ffa8eacacc4d50cfaa495bd448207a
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class D { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc= new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { long n=sc.nextLong(); long s=sc.nextLong(); long temp=n*n; n++; long p=s/temp; System...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n< 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
88bc3a4ea16944bb854472678f57f1cc
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i < n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class SquareCounting { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); long cases=scanner.nextLong(); ArrayList<SandN> arrayList=new ArrayList<>(); for (int i = 0; i < cases; ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
9652082ed836d1b9664b28ec165196fb
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class example { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenize...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
89dc49e8d3ca23d4f75db874ff87be7f
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class A_Square_Counting { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long t= sc.nextLong(); for(long i=0;i<t;i++){ long n= sc.nextLong(); if(n==0)System.out.println(0); else{ ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
bebc88a803212abb570acff8303e36b0
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class CountSquares { public static void main(String[] args) throws IOException { final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(Syste...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
fa090a7dc5154bd3e90114e1513c8fed
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class SquareCounting { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
eaf98fc3130b57eec6ec23d7bdc83870
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class f{ static void f(int []a,int n,ArrayList<Integer> al,boolean []b){ if(al.size()==n){ System.out.println(al); return ; } for(int j=0;j<n;j++){ if(!b[j]){ b[j]=true; al.add(a[j]); f(a,n,al,b); al.re...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
cfd11d881184c5170b548dcc387bcb52
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(),ans; while(t-- >0){ long n=sc.nextLong(); long s=sc.nextLong(); // if(s==1L) // System.out.println(1); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 11
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
345e10ab027f4c2e26eaa206b8476e8b
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
/** This is Lazy Genius HALAL MODE ON HARAM MODE OFF MADE BY SomeOne **/ import java.util.*; import java.io.*; public class Max { public static void main(String[] args) { int t = scan.nextInt(); while(t-->0){ solve(); } } static Sc...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
21f3bfcc03073c84cb66cb32debb9d98
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class SquareCounting { //https://codeforces.com/contest/1646/problem/0 public static void main(String []args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); long n,sum; while(t-- >0){ n=sc.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
1369e979f1713febf5d230429e8902c6
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
//package kriti; import java.io.*; //findindex //checkTriangle import java.util.*; //isSorted //isPrime //print //sort //input public class A { static PrintWriter out = new PrintWriter(System.out); static StringBuilder ans=new StringBuilder(); static FastReader in=new FastReader(); p...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
b4b7626323deba39e9cc9033e02123f0
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextLong(); while (n-- > 0) { long s1=in.nextLong(); long s=in.nextLong(); long sum=s1*s1; long ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
236cd9ce4b3d9bdf6e0fc61b5825729f
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class taskO4O3 { public static void main(String[] args) { Scanner console = new Scanner(System.in); int t = console.nextInt(); for (int i = 0; i < t; i++) { long n = console.nextLong(); long s = console.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a46ebdb2b01184f96aa6b2476e2267d4
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Cf { static Scanner sc = new Scanner(System.in); public static void main(String[] args ) { int t = sc.nextInt(); while (t-- > 0) { long n; long s; n = sc.nextLong(); s = sc.nextLong(); System.out.printl...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
0ce4eb741dd3e1d8799d708b05149a3a
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class round { static PrintWriter pw = new PrintWriter(System.out); static Scanner sc = new Scanner(System.in); pu...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
480c25eadea4a6bd4e9d1383eb8fd743
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class qu1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while( t-->0) { long n= sc.nextInt(); long s = sc.nextLong(); long h=...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
084ce2fb0a7d8d169749454834757ef0
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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){ long n=sc.nextLong(),s=sc.nextLong(),k=n*n; System.out.println(s/k); } } }
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ebdb4cb3465ed22e31518815f9f19cc8
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class bbb { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while (t-- > 0) { long n = in.nextLong(); long s = in.nextLong(); long c =s/(n*n); System.out....
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
648fdb827a9048a5c886336e34401519
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
/*##################################################### ################ >>>> Diaa12360 <<<< ################## ################ Just Nothing ################## ############ If You Need it, Fight For IT; ############ ####################.-. 1 5 9 2 .-.#################### ###################################...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a6288fe48e017389de8e1315a10eb796
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Arrays; import java.util.*; public class Main { public static void main(String[] args) { Scanner ss=new Scanner(System.in); int number =ss.nextInt(); for(int i=1;i<=number;i++){ long x=ss.nextLong(); long s=ss.nextLong(); long result=s/(x * x); System.out.printl...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
fafe500f79e855ec1aa260a7a2cc13be
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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 { // try { // BufferedReader br =...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
434f1433dc65b4f7f4bbb0ecb9dc515d
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t= sc.nextInt(); while(t-->0){ long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(s/(n*n)); // int...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a815a08195e3102b35e572f402aef0be
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
//package com.company; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Random; import java.util.StringTokenizer; public class SquareCounting { public static void main(String[] args) throws IOException{ FastScaner fs = new FastScaner()...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
e9fe06eaa5e4a27906d56da76595ad48
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long t = sc.nextLong(); while (t-- > 0) { long n = sc.nextLong(); long s = sc.nextLong(); long n_square = n * n; ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
79afbcf9ede07536db4c04981df9d42f
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class code { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while (t-->0) { int n = sc.nextInt(); Long s = Long.parseUnsignedLong(sc.next()); if(n==0) System.out....
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
97297e7a2528ec5273cebf7ec984af76
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Main_1ch { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { long y = sc.nextLong(); long x = sc.nextLong(); long z; z ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
1a6d05f786ce143637778012715b36c6
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Main_1ch { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ long y = sc.nextLong(); long x = sc.nextLong(); long z; z = x / (y * y); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
fe763063b19bcc0b3d441d0a7beac50d
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.lang.*; import java.io.*; import java.util.*; import java.math.*; public class A { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("input.txt"...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
edf5c1f7d2e32d66bde2913500dd6bd2
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.lang.*; import java.io.*; import java.util.*; import java.math.*; public class A { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("input.txt"...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
6ad6c6e8aebb2b3a3a47886e9e95fe83
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { FastScanner fs = new FastScanner(); int t = fs.nextInt(); while (t-- != 0) { long n = fs.nextLong(), s = fs.nextLong(); out...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a96a01e97942b8fca339f8556b70e970
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class Main { public static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); public static class InputReader { StringTokenizer stringToken; BufferedReader in; public InputReader() { ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
482dc602de9e66e3023a760821fb6b60
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; /** * * @author Arunas */ public class NewMain { /** * @param args the command line arguments * @return */ public static void main (String[] args) { Scanner sc = new Scanner(System.in); int c = sc.nextInt(); for(int i = 0; i < c; i++){ lo...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
d2b6d2c7a171ebddd42cf80220670c42
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Solution{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); long[] ans=new long[t]; for(int i=0;i<t;i++){ long n=sc.nextLong(); long s=sc.nextLong(); ans[i]=(...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
f5ce7235710840c6ff5b80dacf74b01c
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static Scanner sc = new Scanner(System.in); public static void reverse(int[] arr, int l, int r) { int d = (r - l + 1) / 2; for (int i = 0; i < d; i++) { int t = arr[l + i]; arr[l + i] = arr[r - i]; arr[r - i] = t; } } public st...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
9585f0e366ffdeb69a77933ebfe2e93c
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.lang.*; import java.lang.reflect.Array; import java.util.*; import java.util.concurrent.atomic.LongAccumulator; import javax.management.openmbean.ArrayType; public class Main { static PrintWriter out; static int MOD = 1000000007; static FastReader scan; /*-------- I...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
8e7923bd18173522385ecc776f57ff55
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t; t = sc.nextInt(); while(t>0){ long n = sc.nextLong(); long s = sc.nextLong(); long count = (s/...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
2d48a23ebd7b3fd1099182f22034df94
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.util.Set; im...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
48650550cc5e7b8f0f4dcf0b9ba1864c
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class SquareCounting { static long solve (long n, long s) { return (s/(n*n)); } public static void main(String[]p) { Scanner scan=new Scanner(System.in); long t = scan.nextInt (); int i; for ( i = 0; i < t; i ++) { long n = scan.nextLong (...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
320875080d6e56544cd51c825533b7d3
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class SquareCounting { public static void main(String[]p) { Scanner scan=new Scanner(System.in); long t = scan.nextLong (); int i; for ( i = 0; i < t; i ++) { long n = scan.nextLong (); long s = scan.nextLong (); System.out.println(s/(n*n)); }...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
681a56f215d4c343208ee88de1999a1f
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.awt.*; import java.util.*; import java.io.*; public class Codeforces { static FScanner sc = new FScanner(); static PrintWriter out = new PrintWriter(System.out); static final Random random = new Random(); static long mod = 1000000007L; static HashMap<String, Integer> map = new ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
041095c354662c1f4271573b6fd54ce4
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
/*input 4 7 0 1 1 2 12 3 12 */ import java.util.*; import java.io.*; public class SquareCounting { public static void main(String[] args) { FastReader reader = new FastReader(); int t = reader.nextInt(); while(t-- > 0){ long n = reader.nextLong(); long sum = reader.nextLong(); long nsq = n * n; lo...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
8c3fd7d5d9dfaacedf5bec37d98f185e
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
/*input 4 7 0 1 1 2 12 3 12 */ import java.util.*; import java.io.*; public class SquareCounting { public static void main(String[] args) { FastReader reader = new FastReader(); int t = reader.nextInt(); while(t-- > 0){ long n = reader.nextLong(); long sum = reader.nextLong(); long...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
c390bfbccab0cc7552bf8e34bc0e506e
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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) { long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(1l*s/(n*n)); } ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
25efaacfcb43f501a163d101cfc616e1
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Stc { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { int n = scan.nextInt(); while (n-- > 0) A(); } static void A(){ long n = scan.nextLong(); long s = scan.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
d23b982fb301efaf0df7ac7e1001ad10
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
//package extra; import java.util.*; import java.io.*; public class codeForces { public static void main(String[] args) { FastReader in = new FastReader(); int t = in.nextInt(); while(t-->0) { int n = in.nextInt(); long s = in.nextLong(); long ans = (long)n*(long)n; // System.out...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
6ad93fc6ece08f2e777263c00caa2029
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.io.*; public class CodeForces{ public static void main(String[] args) throws FileNotFoundException { FastScanner fs = new FastScanner(); int t = fs.nextInt(); while(t-- > 0) { long n = fs.nextLong(); long s = fs.nextLong(); System.out.pr...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
5def2634d8b7a96fb70d08bf2d9c9795
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigInteger; import java.util.StringTokenizer; public class A_Square_Counting { static Scanner in = new Scanner(); static P...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
45c2286f960ba1c317fbb382c8d26478
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class A_Square_Counting { static int M = 1_000_000_007; static final PrintWriter out =new PrintWriter(System.out); static final FastReader fs = new FastReader(); static boolean prime[]; public static void main (String[] args...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
fb456427a534bffaed82c6b0f5090b8b
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); StringBuilder output = new StringBuilder(); int t = input.nextInt(); while(t > 0) { int n = input.nextInt(); long s = inp...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a333df037b29c2025729c3eb4277cf3e
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class div_2_774_a { public static void main(String args[]){ FScanner in = new FScanner(); PrintWriter out = new PrintWriter(System.out); int t = in.nextInt(); while(t-->0) { int n=in.nextInt(); long s=in.nextLong(); if(s==0) ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
dda08bf717df4f76dc2333095845ee62
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class cc { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { long n=sc.nextLong(); long s=sc.nextLong(); long pow=n*n; long ans=s/pow; ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
55285930cd23090aaf735432b8871a40
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class A { static PrintWriter pw = new PrintWriter(System.out); static FastReader fr = new FastReader(); public static void main(String[] args) { int t = fr.nextInt(); while (t-- > 0) { sol...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
912dc82e929ae12118f997bd7d9e2515
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class R774A { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputS...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a7c83b3c08bcebc4ad5e1c4656f60dd4
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.awt.*; import java.io.IOException; import java.util.*; import java.util.List; public class test { public static void main(String[] args) { Scanner inputul = new Scanner(System.in); long t = inputul.nextInt(); for (int i = 0; i < t; i++) { long n = in...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
4a9fe0df4f4123cc7e06c90bab906edf
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class SquareCounting { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while (t-->0){ long n=sc.nextLong(); long s=sc.nextLong(); long r=n*n; long r...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
badcc3e8b87798707f7ce7bffcbe5b9b
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { long n = sc.nextLong(); long s = sc.nextLong(); System.o...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
24a618db3ce3a562c5636761c6f0a294
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); for (int i = 0; i < t; i++) { BigInteger small=...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
5d49e8d294edde6d949528709a0b3102
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class A { public static void main(String args[]) throws IOException { PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); int t = nextInt(); while (t-->0) { long n = nextLong(), s = nextLong(); out.pri...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
86592716553e13a73cbe4642c1f3b73d
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class ASquareCounting { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { long n = sc.nextLong(); long s = sc.nextLong(); long nSquare = n*n; ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
d2e696448ceee74b6b144f41f0da8c4b
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import javax.management.Query; import java.io.*; public class Main { // static int n,k; //// static String t,s; // static long[]memo; public static void main(String[] args) throws Exception { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
11c4ab6f15d55f994561b0826b1cefd9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class Main { //--------------------------INPUT READER---------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(I...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
6063e9ac21cbbe0d7bfaf3997f41d7dd
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
// Working program with FastReader import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
9739e0346ce1df7a968568198e98e7a6
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main{ public static void main(String[] args) { try(InputStream inputStream = System.in;){ InputReader in = new InputReader(inputStrea...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ba01791efbf20225e74c189a355b586e
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main{ public static void main(String[] args) { try(InputStream inputStream = System.in;Scanner sc = new Scanner...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a1aecb2af6bf8b7188645910d2b1a5cd
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int m = sc.nextInt(); while (m-- > 0) { long n =sc.nextLong(); long s = sc.nextLong(); long num = n...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
5ddcacab32042e000ef5fb9cd6c88932
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class A { public static void main(String[] args) throws Exception{ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int TC = Integer.parse...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
d74d3576c8f26616a3c6535841c3e3d8
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.lang.*; import java.io.*; import java.util.*; public class My { public static void main(String[] args) { Scanner scn=new Scanner(System.in); long t=scn.nextLong(); while(t-->0) { long a=scn.nextLong(); long b=scn.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
1cd3a65328d5237355cb0aee3eb98cf3
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class A { public static void main(String[] args) throws IOException { // Scanner sc = new Scanner(new FileReader("input.in")); // PrintWriter pw = new PrintWriter(new FileWriter("")); Scanner sc = new Scanner(System.in); PrintWr...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
7ccafcfd3c9299765e338666eb728ead
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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 i = 0; i < t; i++){ long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(((s/(long)(M...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ba01ab41f24e4332e6224203d2282d76
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class SqureCounting { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long t=sc.nextLong(); for(long i=0;i<t;i++){ long n=sc.nextLong(); long s=sc.nextLong(); System.out.println(s/(n*n)...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
5d2a6bd54304bec77e84d527b13a9266
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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 Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.i...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
6823eb72913b768676920ed4144a09e1
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { int count = 0; Scanner scanner = new Scanner(System.in); long t = scanner.nextInt(); long n = 0,s = 0; for (int i = 0;i < t;i++) { n = scanner.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ac935d857b1ab3cbf634bd44f28f3833
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; //import javafx.util.*; public class Main { static FastReader in = new FastReader(); public static void main(String args[])throws IOException { /* * star,rope,TPST * BS,LST,MS,MQ */ Scanner sc = new Scanner(System.in); int t = sc.next...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ba2d9709e943ade7a90d9655447942a6
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.time.Year; import java.util.*; public class Temp { static long t,n,s; static List<Integer> list=new ArrayList<>(); static Scanner sc=new Scanner(System.in); static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); static StreamTokenizer i...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
31bec196ae9cfb62d26e8357123af7c3
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Codeforces { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(System.in); long t=sc.nextLong(); while(t-->0) { Long n=sc.nextLong(); Long s=sc.nextLon...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
15909acc04c31a5c1725f2ca1938769c
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class L3 { public static void main(String[] args) throws Exception{ Scanner br = new Scanner(System.in); int totalInputs = br.nextInt(); for(int i=0;i<totalInputs;i++){ Long n = Long.parseLong(br.next()); Long s = ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
452e660b53fdbb3dcbda3a61fcf3cbff
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class MyClass { public static void main(String args[]) { Scanner sc=new Scanner (System.in); int t= sc.nextInt(); while(t-->0){ long n= sc.nextLong(); long s= sc.nextLong(); long x=n*n; long c=s/x; System.ou...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ac32df3aea184f5ed77231ff642f4b74
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Codeforces774_1 { public static void main(String[] args) { Scanner input =new Scanner(System.in); long t=input.nextInt(); for(long i=0;i<t;i++){ long n=input.nextLong(); Long s=input.nextLong(); Long x=n*n; ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
859f8d8d43de152270042e797149f062
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
//package com.competetive.div; // Working program using Reader Class import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import static java.lang.System.out; public class SquareCounting { // public static void main(String[] args) throws IOException { // Reader ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
9c1f4b8cc3fed9d53815f22be5a49fc9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class A1646 { public static void main(String[] args) { //Input Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); long[] ans = new long[t]; for (int i = 0; i < t; i++) { long n = scanner.nextLong(); long s = scanner.nextLong(); ans[i] = ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
642ef923ece605ba9c395a8040766568
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Main{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); int tcs = sc.nextInt(); for(int tc=0; tc<tcs; tc++){ long n = sc.nextLong(); long s = sc.nextLong(); long pro = n*n; l...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ff8d95bff7ab4b009a34438bddbfcc5a
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.Scanner; public class Contest { public static void main(String[] args) { sc(); } private static void sc(){ Scanner scanner = new Scanner(System.in); int caseNum = scanner.nextInt(); while(caseNum > 0){ long n, s; n = scan...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
4d1bc2635fef5ee3517295b4e28aaeb9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while (T-- > 0) { long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(s / (n*n)); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
6b52d332f5cdd69691309d02dc9aa2b6
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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 i=0;i<t;i++){ long n = sc.nextLong(); long s = sc.nextLong(); System.out.println(s/(n*n)); } } }
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
ba00050511c0d851887f4a06b0d2b411
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.io.*; // BEFORE 31ST MARCH 2022 !! //MAX RATING EVER ACHIEVED-1622(LETS SEE WHEN WILL I GET TO CHANGE THIS) ////*************************************************************************** /* public class E_Gardener_and_Tree implements Runnable{ public static void ma...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
422878e7522aa0745f79ade8fc839690
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
/* Rating: 1461 Date: 04-03-2022 Time: 21-06-30 Author: Kartik Papney Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/ Leetcode: https://leetcode.com/kartikpapney/ Codechef: https://www.codechef.com/users/kartikpapney */ import java.util.*; import java.io.BufferedRe...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
1460562f6c328ae4c052bade8908e4f8
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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) { Long n = sc.nextLong(); Long s = sc.nextLong(); System.out.println(s/(n*n)); } } }
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
0a20c186f9e69c7cedb9584d6a2662e8
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Test { public static void main(String[] args) throws IOException { Reader rd = new Reader(); int t = rd.nextInt(); while (t-- > 0) { long n = rd.nextLong(); long sum = rd.next...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
2a0946bb07a09f4265f562b4dd153748
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public class Main implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); public static void main(String[] args) { new Thread(null, new Main(), "", 256 * (1L << 20)).start(); } public ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a2b8576065a23833b53474f94fd9ba84
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.util.stream.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); StringBuilder result = new StringBuilder(); for(int i = 0; i < t; i++) { long n = scan.nextLong(); long s = scan.nextLong(); ...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
58be29304528c6b2188a58a6c9bdc7c9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; import java.math.*; public class SquareCounting { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { long n = sc.nextLong(); long s = sc.nextLong(); System.out....
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
a3f53db7c2f21d4cfb96554a550d73f9
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 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){ long n = sc.nextLong(); long s = sc.nextLong(); long sq =n*n; if(s<sq){...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
201d3e7cc3bd96c94fc77a710e5f0dd2
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class practice { public static void main(String[] args) { Scanner s= new Scanner(System.in); int t= s.nextInt(); while(t-->0) { long n= s.nextLong(); long sum= s.nextLong(); System.out.println(sum/(n*n)); } } }
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
97bea205bfb7c9042501850ccbf77ec0
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String args[]) throws java.lang.Exception { FastScanner input = new FastScanner(); int tc = input.nextInt(); wo...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
409f771b323d9aa5ef132e37df708847
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.io.*; import java.util.*; public final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output
PASSED
3e78047ac3223f538ec0a5d2e8855832
train_110.jsonl
1646408100
Luis has a sequence of $$$n+1$$$ integers $$$a_1, a_2, \ldots, a_{n+1}$$$. For each $$$i = 1, 2, \ldots, n+1$$$ it is guaranteed that $$$0\leq a_i &lt; n$$$, or $$$a_i=n^2$$$. He has calculated the sum of all the elements of the sequence, and called this value $$$s$$$. Luis has lost his sequence, but he remembers the v...
256 megabytes
import java.util.*; public class Q1 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int test = in.nextInt(); while(test-->0) { long n = in.nextLong(); long s = in.nextLong(); long ans = s/(n*n); System.out.println(ans); } } }
Java
["4\n\n7 0\n\n1 1\n\n2 12\n\n3 12"]
1 second
["0\n1\n3\n1"]
NoteIn the first test case, we have $$$s=0$$$ so all numbers are equal to $$$0$$$ and there isn't any number equal to $$$49$$$.In the second test case, we have $$$s=1$$$. There are two possible sequences: $$$[0, 1]$$$ or $$$[1, 0]$$$. In both cases, the number $$$1$$$ appears just once. In the third test case, we have ...
Java 8
standard input
[ "math" ]
7226a7d2700ee52f52d417f404c42ab7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 2\cdot 10^4$$$). Description of the test cases follows. The only line of each test case contains two integers $$$n$$$ and $$$s$$$ ($$$1\le n&lt; 10^6$$$, $$$0\le s \le 10^{18}$$$). It is guaranteed that the ...
800
For each test case, print one integer — the number of elements in the sequence which are equal to $$$n^2$$$.
standard output