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 | 4f0ab8ea90e00215fcded07b29c20a65 | train_110.jsonl | 1646408100 | $$$ \def\myred#1{\color{red}{\underline{\bf{#1}}}} \def\myblue#1{\color{blue}{\overline{\bf{#1}}}} $$$ $$$\def\RED{\myred{Red}} \def\BLUE{\myblue{Blue}}$$$You are given a sequence of $$$n$$$ non-negative integers $$$a_1, a_2, \ldots, a_n$$$. Initially, all the elements of the sequence are unpainted. You can paint each ... | 256 megabytes | import java.util.*;
import java.io.*;
public class quality_vs_quantity{
//your method here
void quantityFirst(int n , int arr[]){
Arrays.sort(arr);
int j=0;
int k=n-1;
long sumJ=arr[0];
long sumK=arr[n-1];
// System.out.p... | Java | ["4\n3\n1 2 3\n5\n2 8 6 3 1\n4\n3 5 4 2\n5\n1000000000 1000000000 1000000000 1000000000 1000000000"] | 2 seconds | ["NO\nYES\nNO\nNO"] | NoteIn the first test case, there is no possible way to paint the sequence. For example, if you paint the sequence this way: $$$[\myblue{1},\myblue{2},\myred{3}]$$$ (where $$$3$$$ is painted red, $$$1$$$ and $$$2$$$ are painted blue) then $$$\text{Count}(\RED)=1 < \text{Count}(\BLUE)=2$$$, but $$$\text{Sum}(\RED)=3 ... | Java 17 | standard input | [
"brute force",
"constructive algorithms",
"greedy",
"sortings",
"two pointers"
] | 4af59df1bc56ca8eb5913c2e57905922 | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). Description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$3\le n\le 2\cdot 10^5$$$) — the length of the given sequence. The second line of each test c... | 800 | For each test case, print YES if it is possible to paint the given sequence satisfying the above requirements, and NO otherwise. You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response). | standard output | |
PASSED | e404df0563d72a895fa2e330df61c870 | train_110.jsonl | 1646408100 | $$$ \def\myred#1{\color{red}{\underline{\bf{#1}}}} \def\myblue#1{\color{blue}{\overline{\bf{#1}}}} $$$ $$$\def\RED{\myred{Red}} \def\BLUE{\myblue{Blue}}$$$You are given a sequence of $$$n$$$ non-negative integers $$$a_1, a_2, \ldots, a_n$$$. Initially, all the elements of the sequence are unpainted. You can paint each ... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
public class Main {
static class InputReader {
/**
* The default size of the InputReader's bu... | Java | ["4\n3\n1 2 3\n5\n2 8 6 3 1\n4\n3 5 4 2\n5\n1000000000 1000000000 1000000000 1000000000 1000000000"] | 2 seconds | ["NO\nYES\nNO\nNO"] | NoteIn the first test case, there is no possible way to paint the sequence. For example, if you paint the sequence this way: $$$[\myblue{1},\myblue{2},\myred{3}]$$$ (where $$$3$$$ is painted red, $$$1$$$ and $$$2$$$ are painted blue) then $$$\text{Count}(\RED)=1 < \text{Count}(\BLUE)=2$$$, but $$$\text{Sum}(\RED)=3 ... | Java 17 | standard input | [
"brute force",
"constructive algorithms",
"greedy",
"sortings",
"two pointers"
] | 4af59df1bc56ca8eb5913c2e57905922 | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). Description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$3\le n\le 2\cdot 10^5$$$) — the length of the given sequence. The second line of each test c... | 800 | For each test case, print YES if it is possible to paint the given sequence satisfying the above requirements, and NO otherwise. You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response). | standard output | |
PASSED | a3dfa3db96651ba35ff165d1a12b6b66 | train_110.jsonl | 1646408100 | $$$ \def\myred#1{\color{red}{\underline{\bf{#1}}}} \def\myblue#1{\color{blue}{\overline{\bf{#1}}}} $$$ $$$\def\RED{\myred{Red}} \def\BLUE{\myblue{Blue}}$$$You are given a sequence of $$$n$$$ non-negative integers $$$a_1, a_2, \ldots, a_n$$$. Initially, all the elements of the sequence are unpainted. You can paint each ... | 256 megabytes | //package cf;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.*;
import java.util.StringTokenizer;
public class cftt {
static class FastScanner {
BufferedReader br=new BufferedReader(new In... | Java | ["4\n3\n1 2 3\n5\n2 8 6 3 1\n4\n3 5 4 2\n5\n1000000000 1000000000 1000000000 1000000000 1000000000"] | 2 seconds | ["NO\nYES\nNO\nNO"] | NoteIn the first test case, there is no possible way to paint the sequence. For example, if you paint the sequence this way: $$$[\myblue{1},\myblue{2},\myred{3}]$$$ (where $$$3$$$ is painted red, $$$1$$$ and $$$2$$$ are painted blue) then $$$\text{Count}(\RED)=1 < \text{Count}(\BLUE)=2$$$, but $$$\text{Sum}(\RED)=3 ... | Java 17 | standard input | [
"brute force",
"constructive algorithms",
"greedy",
"sortings",
"two pointers"
] | 4af59df1bc56ca8eb5913c2e57905922 | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). Description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$3\le n\le 2\cdot 10^5$$$) — the length of the given sequence. The second line of each test c... | 800 | For each test case, print YES if it is possible to paint the given sequence satisfying the above requirements, and NO otherwise. You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response). | standard output | |
PASSED | 9b02e615f600700e88a19e65d4cdd78a | train_110.jsonl | 1646408100 | $$$ \def\myred#1{\color{red}{\underline{\bf{#1}}}} \def\myblue#1{\color{blue}{\overline{\bf{#1}}}} $$$ $$$\def\RED{\myred{Red}} \def\BLUE{\myblue{Blue}}$$$You are given a sequence of $$$n$$$ non-negative integers $$$a_1, a_2, \ldots, a_n$$$. Initially, all the elements of the sequence are unpainted. You can paint each ... | 256 megabytes | import java.util.Arrays;
import java.util.Scanner;
public class qualityQuantity {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int k=0;k<t;k++){
int n=sc.nextInt();
long[] arr=new long[n];
f... | Java | ["4\n3\n1 2 3\n5\n2 8 6 3 1\n4\n3 5 4 2\n5\n1000000000 1000000000 1000000000 1000000000 1000000000"] | 2 seconds | ["NO\nYES\nNO\nNO"] | NoteIn the first test case, there is no possible way to paint the sequence. For example, if you paint the sequence this way: $$$[\myblue{1},\myblue{2},\myred{3}]$$$ (where $$$3$$$ is painted red, $$$1$$$ and $$$2$$$ are painted blue) then $$$\text{Count}(\RED)=1 < \text{Count}(\BLUE)=2$$$, but $$$\text{Sum}(\RED)=3 ... | Java 17 | standard input | [
"brute force",
"constructive algorithms",
"greedy",
"sortings",
"two pointers"
] | 4af59df1bc56ca8eb5913c2e57905922 | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). Description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$3\le n\le 2\cdot 10^5$$$) — the length of the given sequence. The second line of each test c... | 800 | For each test case, print YES if it is possible to paint the given sequence satisfying the above requirements, and NO otherwise. You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response). | standard output | |
PASSED | 2a3c12a5124f09b20e8723bf7bdc0971 | 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 CodeForces
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
long n;
String s;
for (int i = 0; i < t; i++)
{
n = sc.nextInt();
s = sc.nextLine().substring(1);
System.out.println(Long.parseLo... | 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 | f50d388f5b21abbdc43ccaf44d0c29c2 | 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 CodeForces
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
long n, count = 0;
String s;
for (int i = 0; i < t; i++)
{
n = sc.nextInt();
s = sc.nextLine();
s = s.substring(1);
count = 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 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 | 712fdaafef32cc6bac427307a7d36d7c | 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 CodeForces
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
long n, count = 0, quintillion = Long.parseLong("100000000000000000");
int quintCount = 0;
long percentage = 0;
String s;
for (int i = 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 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 | ee5ad0fd4be8c422aeffa689188f8843 | 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 Main
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
short t;
t=sc.nextShort();
while(t>0)
{
int n,count=0;
long s;
n=sc.nextInt();
s=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 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 | 6d99d18d5cf1e4957321b07b83d0ec10 | 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.Arrays;
import java.util.Scanner;
public class theatre {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(n>0)
{
long n1=sc.nextLong();
long n2=sc.nextLong();
long n3=0;
if(n1==0)
{
n3=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< 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 | 5992b1c4768f6875706495e08538ef8b | 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 SquareCounting {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int t = Integer.parseInt(s.nextLine());
for(int i=0; i<t; i++){
long n = s.nextLong();
long ss = s.nextLong();
if(... | 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 | 8527088836e07f35b92b8fe7b2ffa185 | 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 Main {
public static void main(String[] args) {
Scanner x = new Scanner(System.in);
var y = x.nextLong();
for (int i = 0; i < y; i++) {
var n = x.nextLong();
var s = x.nextLong();
System.out.println((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 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 | 1e521c33fa3644e4302cd5f4c2e911aa | 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 Main {
public static void main(String[] args) {
Scanner x = new Scanner(System.in);
long y = x.nextLong();
for (int i = 0; i < y; i++) {
long n = x.nextLong();
long s = x.nextLong();
System.out.println((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 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 | 7401f60c7f5d420d8c6a7b407ff4e794 | 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 Test {
public static void main(String[] args) {
int T;
Scanner sc = new Scanner(System.in);
T = sc.nextInt();
sc.nextLine();
for(int i = 0;i < T;i++) {
long n = sc.nextLong();
long s = sc.nextLong();
sc.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 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 | 1332d7f7429e986d6e380fb28c9fe670 | 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 codeforces{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
long n,s;
n=sc.nextLong();
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 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 | f17cc7429f5c5bb1451ae412b234e663 | 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 | // 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 Sol{
public static void main(String[] arg) {
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 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 | 08c299721cd8da5885ac73b1a7005483 | 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.math.BigInteger;
import java.util.Scanner;
public class SquareCounting {
public static void main(String[] args) {
Scanner s1 = new Scanner(System.in);
int m = s1.nextInt();
BigInteger[] s = new BigInteger[m];
BigInteger[] n = new BigInteger[m];
for (int i = 0; i < m; i++) {
n[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 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 | 06c7ba1cf1a3df665d081c12de460b02 | 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 Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
for (int i = 0;i<num;i++){
long n = sc.nextLong();
long s = sc.nextLong();
long squared = n*n;
if (s<squared){
System.out.println(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 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 | 9ed71dbd4f74494189a873057c20735c | 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 Main {
public static void main(String args[]){
Scanner s = new Scanner(System.in);
int t = s.nextInt(); // number of test cases
while(t>0){
long n = s.nextLong();
long sum = s.nextLong();
long c = 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 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 | a3203e3e8e66a7612420d390c9303faf | 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 class381 {
public static void main(String arg[])
{
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;
long c=s/sq;
System.out.println(c);
}
}
} | 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 | ec66b94d98600b84aaf71a215c04b19f | 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 Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
long n,s;
while (t-- > 0) {
n=sc.nextLong();
s=sc.nextLong();
if(n>s) System.out.println(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 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 | df607d95f9dbd3d3c9631073ea008cce | 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.*;
import java.io.*;
import java.math.*;
public class square{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while(t --> 0){
BigInteger n = new BigInteger(in.next());
BigInteger 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 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 | bd2fdba9bd7afadf8e41991afa00b298 | 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.StringTokenizer;
import java.io.*;
public class c {
public static void main(String[] args) {
PrintWriter pw = new PrintWriter(System.out);
FastReader sc = new 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 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 | 94035152b43ad2f6bea54231c0d2dd08 | 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 onlysample {
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();
n=n*n;
long count=s/n;
System.out.println(count);
... | 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 | aff5e0d5d8f61eebc2ca5a5ce990b779 | 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.math.BigInteger;
import java.util.Scanner;
public class Div_2_774_A {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long t = sc.nextInt();
while(t -- > 0){
BigInteger n = sc.nextBigInteger();
BigInteger 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 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 | f54875c509a43ef9ca180708302c0465 | 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;
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
for(int i=0; i<t; i++){
long n = scn.nextLong();
long s = scn.nextLong();
long temp = n*n;
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 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 | fee60ca08069681bb6eb49b632a5af9a | 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 Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
for(int i = 0; i < t; i ++){
long n = scanner.nextLong();
long nSquared = n * n;
long s = 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 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 | 25f45818b6fb3c97e89f6e906beeb828 | 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 SquareCounting{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
if(t>=1&&t<=20000){
while(t>0){
long s,n;
n = sc.nextLong();
s = sc.nextLong();
if(n>=1&&n<=10000... | 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 | b50c7151cf41d1751be4674615cb3f24 | 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 Problem{
public static void main(String args[]){
Scanner obj = new Scanner(System.in);
int t = obj.nextInt();
while(t!=0){
Long n = obj.nextLong();
Long s = obj.nextLong();
Long val = 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 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 | e49c79a9605897a466e54e561828272a | 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 squareCounting {
public static void main(String [] args) {
Scanner in = new Scanner(System.in);
int cases = in.nextInt();
for (int i = 0; i < cases; i++) {
long n = in.nextLong();
long s = in.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 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 | 1073131c6914ba5b4fb74962ab9fc9d9 | 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 squareCounting {
public static void main(String [] args) {
Scanner in = new Scanner(System.in);
int cases = in.nextInt();
for (int i = 0; i < cases; i++) {
long n = in.nextLong();
long s = in.nextLong();
solv... | 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 | 7ee547faba15d68f96f6be52d69911f6 | 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 static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
import java.math.*;
public class Template {
static int mod = 1000000007;
public static void main(String[] args){
F... | 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 | be85cce5a96407dba556eee7aaf3a8f9 | 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 Main {
public static void main(String[] args) {
Scanner var = new Scanner(System.in);
int T = var.nextInt();
for(int i = 1; i <= T; i ++){
long n = var.nextLong();
long s = var.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 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 | b9fd7567207f5f76d319a3654fe09c63 | 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 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)(... | 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 | 6ddc006412be02998cf42858f55f884d | 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.*;
import java.io.*;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw= new PrintWriter(System.out);
StringTokenizer st= new StringTokenizer(br.readLine());
int n= Integer.pars... | 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 | f1719f36d4e435457515e17b38ac43aa | 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 Main{
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int c = sc.nextInt();
for(int count = 1;count<=c;count++){
long val;
long n = sc.nextLong();
long s = sc.nextLong();
long f = n*n;
if(s!=0 && s>=f){
... | 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 | 1e8e4ffd23015eac66a0e771e0562e56 | 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 Codeforces {
public static void main(String[] args) {
try {
Scanner sc = new Scanner(System.in);
long t = sc.nextLong();
while (t-- > 0) {
long n = sc.nextLong();
long s = 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 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 | 57f5c5612a6fdd0faff43d5fc060ce4b | 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 static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;
public class A_Square_Counting {
public static void main(String[] args) {
OutputStream outputStream = System.out;
PrintWrit... | 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 | b7aa78b3cb4ed24e364d06e268966b62 | 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 A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
StringBuilder builder = new StringBuilder();
while (t-- > 0) {
long n = scanner.nextInt();
long s = scanne... | 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 | f856b8c2e8bfde3f3ea5bb6c26663917 | 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 rational_number{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
long t=sc.nextLong();
for(int i=0;i<t;i++) {
long n = sc.nextLong();
long s = sc.nextLong();
System.out.println(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 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 | b6aa4cad7c544d5ea70832ea0e2da373 | 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 squareCounting {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0) {
long n = s.nextInt();
long s1 = s.nextLong();
long sq = n*n;
System.out.println(s1/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 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 | 7d31fa9d69865fd14cc8115f065e71ca | 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 codeforces_4March {
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.print... | 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 | c698e95a892399e46b5c72c9791b67b3 | 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 Square_Counting
{
public static void main(String Args[])
{
Scanner obj = new Scanner(System.in);
int t = obj.nextInt();
while (t > 0)
{
t--;
int n = obj.nextInt();
long s = obj.nextLong();
double 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 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 | 105b6ddc19ef2ca40833e567ecea648c | 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.math.BigInteger;
import java.util.*;
public class ProgramJava {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while (T>0){
T--;
long n = sc.nextLong();
long s = sc.nextL... | 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 | 4abdc2992cf1aca193390f74e4f78a17 | 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.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
// if (System.getProperty("ONLINE_JUDGE") == null) {
// try {
// System.setOut(new PrintStream(
// ... | 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 | b4d2e3e4531911f08ec5b2c3d7976499 | 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.*;
/*
4
7 0
1 1
2 12
3 12
*/
public class Creep {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
while(t>0){
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 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 | 8609ad270800b22385a8b5b6b8d5465d | 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 thisDaMain {
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();
if(s<n*n || s==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 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 | d6813c6e8059854d3a42852fda787a9b | 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.*;
import java.io.*;
import static java.lang.System.*; // for error stream (static) was necessary.
// @author : sam45jh
public class Main{
/* declare some global variables */
static FastReader scn;
static FastWriter out;
static int imax = Integer.MAX_VALUE;
static int imi... | 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 | 1df9c9060d1d782afb51241fcc5f1475 | 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 P1646A {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
int count = scanner.nextInt();
for (int i = 0; i < count; i++) {
solve3(scanner);
}
}
public static void solv... | 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 | 8a34edf68adc225526cdcbc7e86ddffe | 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.lang.reflect.Array;
import java.util.*;
public class Main {
static Kattio io;
static long mod = 998244353, inv2 = 499122177;
static {
io = new Kattio();
}
public static void main(String[] args) {
int t = io.nextInt();
for (int 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 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 | 6d943d9c588eb257e0e04a0acdf9b4ff | 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.*;
import java.io.*;
public class Main {
static FastReader in=new FastReader();
static final Random random=new Random();
static long mod=1000000007L;
static HashMap<String,Integer>map=new HashMap<>();
public static void main(String args[]) throws IOException {
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 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 | 741099359bbea1521562457d852cc4b2 | 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 SquareCounting {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0) {
long a = s.nextLong();
long b = s.nextLong();
if (a * a > b) {
System.out.println(0);
}
else {
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 | f824fcfa3eec31f53725263ee3911c28 | 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 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 count=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 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 | 723a64ae6d587e45a70fca9678077fde | 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.*;
import java.lang.*;
public class Main{
public static void main(String args[]){
Scanner inp=new Scanner(System.in);
long t=inp.nextLong();
for(long i=0;i<t;i++){
long count=0,coun=0;
long n=inp.nextLong();
long s=inp.nextLong();
long sample=n*n;
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 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 | 81286f02615d8dac21c3f6c7cce4561e | 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.*;
import java.io.*;
import java.util.Arrays;
public class solution {
static FastReader in=new FastReader();
static final Random random=new Random();
static long mod=1000000007L;
static HashMap<String,Integer>map=new HashMap<>();
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 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 | 2fd7fa58b00e412b0c7680eb0a7e0450 | 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.*;
import java.io.*;
import java.math.BigInteger;
public class EG {
static int lsb(int n) {
for(int i=31;i>=0;i--) {
int num=1<<i;
if((num&n)!=0)return i;
}
return 0;
}
public static void main(String[] args){
FastScanner fs=new FastScanner();
int t=fs.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 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 | 96ce7dbf15e14d10f5091745d9934300 | 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 go {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int x= sc.nextInt();
while(x-- !=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 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 | e0f607714a1854953bb8ccffcdc4107e | 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 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 r = s/(n*n);
System.out.println(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 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 | 4984173fa6ccf64b684c9286662afbaf | 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 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 r = s/(n*n);
System.out.println(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 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 | ac1f457aba504f82ad68d643e995d1a1 | 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.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.StringTokenizer;
public class cf {
static class FastReader {
BufferedReader br;
StringTokenizer 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 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 | 7128f60b71241371f2aeb4937f2cfa93 | 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 Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while(t-- > 0) {
System.out.println(solve(in));
}
}
public static long solve(Scanner in) {
long n = in.nextLong();
long s = in.nextL... | 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 | 45ecaa4078244c60ba04c24cadc78dec | 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.*;
/**
*
* @author xpeng
*/
import java.util.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
public class USACO {
static BufferedReade... | 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 | c6b880acd4e893021b2b721f995c7cb2 | 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.StringTokenizer;
import java.io.PrintWriter;
public class A {
static final FastReader sc = new FastReader();
static final PrintWriter out = new PrintWriter(System.out);
public static void main(... | 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 | 35526f87587b094972b74ee1d9048f20 | 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 | // 4
// 7 0 // 0
// 1 1 // 1
// 2 12 // 3
// 3 12 // 1
import java.util.*;
public class SquareCounting {
public static void main(String[] args) {
Scanner scan = new Scanner(System.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 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 | 9ff9e8e347103e07b6db75c05a0d8207 | 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 Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan = new Scanner(System.in);
//ArrayList<Character> letters = new ArrayList<Character>();
// int[] a = {6,7,13,14,20,21,27,28};
int x = scan.nextInt();
for(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 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 | b06ab7bc946b808e4a3bba2e00ddcc0b | 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 P3 {
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
int t=in.nextInt();
long []n=new long[t];
long []s=new long[t];
for(int i=0;i<t;i++) {
n[i]=in.nextLong();
s[i]=in.nextLong();
}
for(int i=0;i<t;i++) {
if(s[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 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 | 436dd758a347ac00212989cf6e91c976 | 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 P2 {
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
int t=in.nextInt();
long []n=new long[t];
long []s=new long[t];
for(int i=0;i<t;i++) {
n[i]=in.nextLong();
s[i]=in.nextLong();
}
for(int i=0;i<t;i++) {
long k=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 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 | 56aa1dde053b3ac0c85ed9b6b419fc26 | 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 plusOne {
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 ans= 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 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 | 63029973eafee731ca58eb7b24602259 | 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.*;
import java.io.*;
import java.security.KeyStore.Entry;
public class Main{
static final Random random=new Random();
static long mod=1000000007L;
static HashMap<String,Integer>map=new HashMap<>();
static class FastReader{
BufferedReader br;
StringTokeniz... | 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 | 5d0322565254edf83a30d02e907bed9a | 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;
//import java.lang.*;
public class A
{
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();
long nsquared = n * n;
long resu... | 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 | d90986721d91b2bc2521dda8ff94f93d | 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 maiin {
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 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 | 64e0440616bed772c20e2350a0a329cc | 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 Square_Counting {
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 sqr = n*n;
long count = s/sqr... | 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 | aa3889d599d3a93ea375e55141afb91e | 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 codeforces_4_march_A {
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.nextInt();
long s = 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 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 | 903c97a28a6fe005c90d8266eca958bd | 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 counting {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int numCases = scanner.nextInt();
for (int i = 0; i < numCases; i++) {
int n = scanner.nextInt();
long s = scanner.nextLong();
long max = (long)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 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 | 84c40422cf34328036dcdf67c01d3ca8 | 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.*;
import java.io.*;
public class Main {
static StringBuilder sb;
static dsu dsu;
static long fact[];
static int mod = (int) (1e9 + 7);
static void solve() {
long n=i();
long s=l();
long ans=0;
long lo=0;
long hi=n+1;
while(lo<=hi){
lon... | 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 | bfda7b092d2582a2d1b4a8a0393662d7 | 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.StringTokenizer;
public class A_Square_Counting {
static void solve(long n, long sum) {
if (sum == 0) {
System.out.println(0);
} else {
long ans = sum / (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 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 | 11a22f2103076330847df1f7ce8189f3 | 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.math.BigInteger;
import java.util.Scanner;
public class Main {
static Scanner s = new Scanner(System.in);
public static void main(String[] args) {
int test_cases = s.nextInt();
for (int i = 0; i < test_cases; i++) {
test_output();
}
}
static void te... | 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 | 7a0fc1a5cb6fd5d473b53fc8c3d2798f | 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.*;
import java.lang.*;
import java.io.*;
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
FastReader s = new FastReader();
int t = s.nextInt();
while(t-- != 0){
// if(n = 0){
// Sy... | 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 | da7c33f04703c058d3d11a6d527823a8 | 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 Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-->0){
long x = sc.nextLong();
long y = sc.nextLong();
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 | 432938953562a31d56d2317e32b95765 | 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.*;
import java.io.*;
public class Solution{
//class CodeChef{
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer st = null;
public static void main(String[] args)throws IOException {
int testcase = Integer.parseInt(... | 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 | 211b9b571d2035e0a795969d3cd421d3 | 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 | //'main' method must be in a class 'Rextester'.
//openjdk version '11.0.5'
import java.util.*;
import java.lang.*;
public class Rextester
{
public static void main(String args[])
{
Scanner sc =new Scanner(System.in);
int t=sc.nextInt();
while(t-->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 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 | 82c95ec97aa3d2327f1c65aa09b216c7 | 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 javax.print.DocFlavor;
import java.net.CookieHandler;
import java.util.*;
public class Solution
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
for(int t = in.nextInt();t>0;t--)
{
long n = in.nextLong();
long s = in.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 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 | adec693fb02100d12d11e1ea1c6a62f4 | 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;
import javax.lang.model.util.ElementScanner6;
import java.lang.*;
import java.util.*;
public class codeforces
{
public static void main(String[] args) {
Scanner ob = new Scanner(System.in);
int t =ob.nextInt();
while (t-->0) {
int n = ob... | 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 | 7beceb4bb80c0c32a38c00c89dbf2ad3 | 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.*;
import java.io.*;
public class cf1646A {
public static void main(String[] args) {
FastReader in = new FastReader();
int t = in.nextInt();
for (int i = 0; i < t; i++) {
int n = in.nextInt();
long s = in.nextLong();
if ((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 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 | ae4effbcbdcc2963b5e91824162191c9 | 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 Main{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
outer: while(x-->0)
{
long n=sc.nextLong();
long k=sc.nextLong();
System.out.println((k/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 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 | e77a22f74088cdb9853e424e353ee299 | 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.*;
public class A {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(
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 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 | f616a8f2c4ba1fc2ea8a3a9d589910ae | 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.*;
import java.io.*;
public class B {
static FastScanner fs = new FastScanner();
static PrintWriter pw = new PrintWriter(System.out);
static StringBuilder sb = new StringBuilder("");
static int[] b = new int[1000001];
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 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 | 3503115ad16f46d4a1c623a0ce83749f | 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.InputStreamReader;
import java.util.Scanner;
public class squarecountonh {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
int t = sc.nextInt();
while (t-- > 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 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 | 3013a80a28676945f3ee47a7ce8be63d | 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.*;
public class CF_774 {
static FastScanner fs;
static FastWriter fw;
static boolean checkOnlineJudge = System.getProperty("ONLINE_JUDGE") == null;
private static final int[][] kdir = new int[][]{{-1, 2}, {-2, 1}, {-2, -1}, {-1, -2}, {1, -2}, {2, -1}, {2, 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< 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 | a009a42f2b6c62a9f6c13a73aee78704 | 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 squarecount {
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 = sc.nextLong();
long square = (long)n * n;
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 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 | 7981a75b11e46428c59f2e11784e36ab | 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.StringTokenizer;
public class Test {
public static void main(String[] args) {
FastReader scanner = new FastReader();
int t = scanner.nextInt();
for (int i = 0; i < t; 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 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 | 5cf66bee903a4b4cfa5437dff33ef8a4 | 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.*;
public class Solution{
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public 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 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 | 356343c8346cdefa481d85c8e74edee6 | 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 A {
public static void main(String[] args) {
Scanner go = new Scanner(System.in);
int t = go.nextInt();
while (t-->0){
int n = go.nextInt();
long s = go.nextLong();
long f = 0;
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 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 | 806e95776ad1c560d7324321dd7da35c | 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 Ground1 {
public static void main(String[] args) {
Scanner myScanner = new Scanner(System.in);
int cases = myScanner.nextInt();
for (int i = 0; i < cases; i++) {
int n = myScanner.nextInt();
long s = myScanner.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 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 | 2630c3caac00a9adbfc82e508cd33c03 | 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.net.Inet4Address;
import java.nio.Buffer;
import java.util.*;
import java.text.*;
import java.lang.*;
public class a {
static int[] arr;
static int t;
public static void main(String[] args) throws IOException{
BufferedReader inp = new BufferedReader(new 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 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 | 32b78f2fb9bfe9eb27263822aa45ab6a | 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 A_Square_Counting{
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0){
long n = sc.nextLong();
long s = sc.nextLong();
long squa... | 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 | 9e32330418fda6ed2c9402cd07be3ee7 | 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 App {
public static void main(String[] args) throws Exception {
Scanner scanner =new Scanner(System.in);
int T=scanner.nextInt();
for (int i = 0; i < T; i++) {
Long number=scanner.nextLong();
long sum=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 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 | 4269db0110cbba0ac7e8f6f681d796b1 | 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 Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while (t-->0){
long n = scanner.nextInt();
long s = scanner.nextLong();
long sqN = 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 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 | 67122004af71de493ff15a10721c2c37 | 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.math.BigInteger;
import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for (int i = 0; i < n; i++) {
BigInteger nn = new BigInteger(in.next());
BigInte... | 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 | 748dc348dda419ea87f5febc85f85bbb | 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.*;
public class Solution {
static int mod = 1000000007;
public static void main(String[] args) throws FileNotFoundException {
FastScanner fs = new FastScanner();
int t = fs.nextInt();
outer: while (t-- > 0) {
long n = fs.nextLong();
long s = fs.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 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 | 6d99577f8cbfbdc8c2ab05d9a488da7c | 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.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.*;
public class Main {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer 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 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.