prob_desc_description
stringlengths
63
3.8k
prob_desc_output_spec
stringlengths
17
1.47k
βŒ€
lang_cluster
stringclasses
2 values
src_uid
stringlengths
32
32
code_uid
stringlengths
32
32
lang
stringclasses
7 values
prob_desc_output_to
stringclasses
3 values
prob_desc_memory_limit
stringclasses
19 values
file_name
stringclasses
111 values
tags
listlengths
0
11
prob_desc_created_at
stringlengths
10
10
prob_desc_sample_inputs
stringlengths
2
802
prob_desc_notes
stringlengths
4
3k
βŒ€
exec_outcome
stringclasses
1 value
difficulty
int64
-1
3.5k
βŒ€
prob_desc_input_from
stringclasses
3 values
prob_desc_time_limit
stringclasses
27 values
prob_desc_input_spec
stringlengths
28
2.42k
βŒ€
prob_desc_sample_outputs
stringlengths
2
796
source_code
stringlengths
42
65.5k
hidden_unit_tests
stringclasses
1 value
We have a secret array. You don't know this array and you have to restore it. However, you know some facts about this array: The array consists of $$$n$$$ distinct positive (greater than $$$0$$$) integers. The array contains two elements $$$x$$$ and $$$y$$$ (these elements are known for you) such that $$$x < y$$$....
For each test case, print the answer: $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$), where $$$a_i$$$ is the $$$i$$$-th element of the required array. If there are several answers, you can print any (it also means that the order of elements doesn't matter). It can be proven that such an array al...
C
ca9d97e731e86cf8223520f39ef5d945
e71fb3dc9c2d78dc0467bfe41eefd0f6
GNU C11
standard output
256 megabytes
train_000.jsonl
[ "number theory", "brute force", "math" ]
1599230100
["5\n2 1 49\n5 20 50\n6 20 50\n5 3 8\n9 13 22"]
null
PASSED
1,200
standard input
1 second
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) β€” the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains three integers $$$n$$$, $$$x$$$ and $$$y$$$ ($$$2 \le n \le 50$$$; $$$1 \le x < y \le 50$$$) β€” the length of the array and two elements ...
["1 49 \n20 40 30 50 10\n26 32 20 38 44 50 \n8 23 18 13 3 \n1 10 13 4 19 22 25 16 7"]
///I must try more than once #include<stdio.h> #include<math.h> void test() { int n,x,y; scanf("%d%d%d",&n,&x,&y); int sub=y-x,b=sqrt(sub); int i,aa,bb,max,ans,qq,mul; ans=sub*(n-2)+y,qq=sub; ///printf("%d\n",ans); for(i=1;i<=b;i++){ if(sub%i==0){ ...
Vasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicted in Homer's Odysseus... How can he explain to his literature teacher that he isn't going to become a writer? In fact, he is going to become a programmer. So, he would take great pleasure in writing a program, b...
Print a single integer β€” the minimum number of times Vasya should push a key to move the cursor from position (r1, c1) to position (r2, c2).
C
d02e8f3499c4eca03e0ae9c23f80dc95
f00a075eec6879ac246b786365be5f94
GNU C
output.txt
256 megabytes
train_000.jsonl
[ "greedy", "graphs", "shortest paths", "data structures", "dfs and similar" ]
1354960800
["4\n2 1 6 4\n3 4 4 2", "4\n10 5 6 4\n1 11 4 2", "3\n10 1 10\n1 10 1 1"]
NoteIn the first sample the editor contains four lines. Let's represent the cursor's possible positions in the line as numbers. Letter s represents the cursor's initial position, letter t represents the last one. Then all possible positions of the cursor in the text editor are described by the following table.12312123s...
PASSED
1,600
input.txt
1 second
The first line of the input contains an integer n (1 ≀ n ≀ 100) β€” the number of lines in the file. The second line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 105), separated by single spaces. The third line contains four integers r1, c1, r2, c2 (1 ≀ r1, r2 ≀ n, 1 ≀ c1 ≀ ar1 + 1, 1 ≀ c2 ≀ ar2 + 1).
["3", "6", "3"]
#include <stdlib.h> #include <stdio.h> #include <string.h> #define qlen 400000 int q[qlen][2], dr[] = {-1, 0, 1, 0}, dc[] = {0, 1, 0, -1}; int main() { int n, *x, i, j, r, c, R, C, r_target, c_target; int **dist, tail = 0, head = 1; FILE *f_in = fopen("input.txt", "r"); FILE *f_out = fopen("output.txt", "w"); ...
Vasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicted in Homer's Odysseus... How can he explain to his literature teacher that he isn't going to become a writer? In fact, he is going to become a programmer. So, he would take great pleasure in writing a program, b...
Print a single integer β€” the minimum number of times Vasya should push a key to move the cursor from position (r1, c1) to position (r2, c2).
C
d02e8f3499c4eca03e0ae9c23f80dc95
b4342969abf0f297998e6039f73f9d8d
GNU C
output.txt
256 megabytes
train_000.jsonl
[ "greedy", "graphs", "shortest paths", "data structures", "dfs and similar" ]
1354960800
["4\n2 1 6 4\n3 4 4 2", "4\n10 5 6 4\n1 11 4 2", "3\n10 1 10\n1 10 1 1"]
NoteIn the first sample the editor contains four lines. Let's represent the cursor's possible positions in the line as numbers. Letter s represents the cursor's initial position, letter t represents the last one. Then all possible positions of the cursor in the text editor are described by the following table.12312123s...
PASSED
1,600
input.txt
1 second
The first line of the input contains an integer n (1 ≀ n ≀ 100) β€” the number of lines in the file. The second line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 105), separated by single spaces. The third line contains four integers r1, c1, r2, c2 (1 ≀ r1, r2 ≀ n, 1 ≀ c1 ≀ ar1 + 1, 1 ≀ c2 ≀ ar2 + 1).
["3", "6", "3"]
#include<stdio.h> //#include<string.h> //#include<stdlib.h> int max(int a,int b) { return (a>b)?a:b; } int min(int a,int b) { return (a<b)?a:b; } int main() { FILE *fin = fopen ("input.txt", "r"); FILE *fout = fopen ("output.txt", "w"); int i,j,n,a[111111],x1,y1,x2,y2,casex,minx,maxx,miny,maxy,tt...
Vasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicted in Homer's Odysseus... How can he explain to his literature teacher that he isn't going to become a writer? In fact, he is going to become a programmer. So, he would take great pleasure in writing a program, b...
Print a single integer β€” the minimum number of times Vasya should push a key to move the cursor from position (r1, c1) to position (r2, c2).
C
d02e8f3499c4eca03e0ae9c23f80dc95
a6cbecd7db5fa5f0bb2dc98455df0b78
GNU C
output.txt
256 megabytes
train_000.jsonl
[ "greedy", "graphs", "shortest paths", "data structures", "dfs and similar" ]
1354960800
["4\n2 1 6 4\n3 4 4 2", "4\n10 5 6 4\n1 11 4 2", "3\n10 1 10\n1 10 1 1"]
NoteIn the first sample the editor contains four lines. Let's represent the cursor's possible positions in the line as numbers. Letter s represents the cursor's initial position, letter t represents the last one. Then all possible positions of the cursor in the text editor are described by the following table.12312123s...
PASSED
1,600
input.txt
1 second
The first line of the input contains an integer n (1 ≀ n ≀ 100) β€” the number of lines in the file. The second line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 105), separated by single spaces. The third line contains four integers r1, c1, r2, c2 (1 ≀ r1, r2 ≀ n, 1 ≀ c1 ≀ ar1 + 1, 1 ≀ c2 ≀ ar2 + 1).
["3", "6", "3"]
#include <stdio.h> int linfc, colfc; int menor(int a, int b) { if(a>b) return b; return a; } int modulo(int a, int b) { if(a>b) return a-b; return b-a; } int resolve(int linic, int colic, int mov1, int car[], int up) { mov1+=modulo(linic, linfc); while(linic!=linfc) { if(car[linic+up]+1<colic) colic...
Vasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicted in Homer's Odysseus... How can he explain to his literature teacher that he isn't going to become a writer? In fact, he is going to become a programmer. So, he would take great pleasure in writing a program, b...
Print a single integer β€” the minimum number of times Vasya should push a key to move the cursor from position (r1, c1) to position (r2, c2).
C
d02e8f3499c4eca03e0ae9c23f80dc95
900384dbcde0cc1df7df911f9f969190
GNU C
output.txt
256 megabytes
train_000.jsonl
[ "greedy", "graphs", "shortest paths", "data structures", "dfs and similar" ]
1354960800
["4\n2 1 6 4\n3 4 4 2", "4\n10 5 6 4\n1 11 4 2", "3\n10 1 10\n1 10 1 1"]
NoteIn the first sample the editor contains four lines. Let's represent the cursor's possible positions in the line as numbers. Letter s represents the cursor's initial position, letter t represents the last one. Then all possible positions of the cursor in the text editor are described by the following table.12312123s...
PASSED
1,600
input.txt
1 second
The first line of the input contains an integer n (1 ≀ n ≀ 100) β€” the number of lines in the file. The second line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 105), separated by single spaces. The third line contains four integers r1, c1, r2, c2 (1 ≀ r1, r2 ≀ n, 1 ≀ c1 ≀ ar1 + 1, 1 ≀ c2 ≀ ar2 + 1).
["3", "6", "3"]
#include <stdio.h> int d[100][100001]; int used[100][100001]; int lenght[100]; struct step { int r; int c; } queue[100 * 100001]; int qh = 0, qt = 0; void add(int r, int c) { queue[qh].r = r; queue[qh].c = c; qh++; } struct step get() { qt++; return queue[qt - 1]; } int min(int a, i...
Alexandra has an even-length array $$$a$$$, consisting of $$$0$$$s and $$$1$$$s. The elements of the array are enumerated from $$$1$$$ to $$$n$$$. She wants to remove at most $$$\frac{n}{2}$$$ elements (where $$$n$$$ β€” length of array) in the way that alternating sum of the array will be equal $$$0$$$ (i.e. $$$a_1 - a_...
For each test case, firstly, print $$$k$$$ ($$$\frac{n}{2} \leq k \leq n$$$) β€” number of elements that will remain after removing in the order they appear in $$$a$$$. Then, print this $$$k$$$ numbers. Note that you should print the numbers themselves, not their indices. We can show that an answer always exists. If ther...
C
eca92beb189c4788e8c4744af1428bc7
36e8631a5dfbdf5f9d343444622f377e
GNU C11
standard output
256 megabytes
train_000.jsonl
[ "constructive algorithms", "math" ]
1599575700
["4\n2\n1 0\n2\n0 0\n4\n0 1 1 1\n4\n1 1 0 0"]
NoteIn the first and second cases, alternating sum of the array, obviously, equals $$$0$$$.In the third case, alternating sum of the array equals $$$1 - 1 = 0$$$.In the fourth case, alternating sum already equals $$$1 - 1 + 0 - 0 = 0$$$, so we don't have to remove anything.
PASSED
1,100
standard input
1 second
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). Description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 10^3$$$, $$$n$$$ is even) Β β€” length of the array. The second line contains ...
["1\n0\n1\n0\n2\n1 1\n4\n1 1 0 0"]
#include <stdio.h> #include <stdlib.h> long long int min(long long int a,long long int b) { if(a<=b) return(a); else return(b); } int main() { int t,i; scanf("%d",&t); for(i=0;i<t;i++) { int n,o=0,z=0,k=0,f=0,mp=0;scanf("%d",&n);int a[n],j;for(j=0;j<n;j++)scanf("%d",(a+j...
Alexandra has an even-length array $$$a$$$, consisting of $$$0$$$s and $$$1$$$s. The elements of the array are enumerated from $$$1$$$ to $$$n$$$. She wants to remove at most $$$\frac{n}{2}$$$ elements (where $$$n$$$ β€” length of array) in the way that alternating sum of the array will be equal $$$0$$$ (i.e. $$$a_1 - a_...
For each test case, firstly, print $$$k$$$ ($$$\frac{n}{2} \leq k \leq n$$$) β€” number of elements that will remain after removing in the order they appear in $$$a$$$. Then, print this $$$k$$$ numbers. Note that you should print the numbers themselves, not their indices. We can show that an answer always exists. If ther...
C
eca92beb189c4788e8c4744af1428bc7
e0fbdd666baa82a5b9327a855eb41a74
GNU C11
standard output
256 megabytes
train_000.jsonl
[ "constructive algorithms", "math" ]
1599575700
["4\n2\n1 0\n2\n0 0\n4\n0 1 1 1\n4\n1 1 0 0"]
NoteIn the first and second cases, alternating sum of the array, obviously, equals $$$0$$$.In the third case, alternating sum of the array equals $$$1 - 1 = 0$$$.In the fourth case, alternating sum already equals $$$1 - 1 + 0 - 0 = 0$$$, so we don't have to remove anything.
PASSED
1,100
standard input
1 second
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). Description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 10^3$$$, $$$n$$$ is even) Β β€” length of the array. The second line contains ...
["1\n0\n1\n0\n2\n1 1\n4\n1 1 0 0"]
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int a[n+1],i,k=0,k_=0,p,m; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i]==1) k++; else k_++; } p=n/...
The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to qu...
Print a single number β€” the minimal number of clicks needed to pass the test it the worst-case scenario. Please do not use the %lld specificator to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specificator.
C
c8531b2ab93993b2c3467595ad0679c5
78a1b4bfd610160f30945a548a47e09f
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "greedy", "math" ]
1312714800
["2\n1 1", "2\n2 2", "1\n10"]
NoteNote to the second sample. In the worst-case scenario you will need five clicks: the first click selects the first variant to the first question, this answer turns out to be wrong. the second click selects the second variant to the first question, it proves correct and we move on to the second question; the thi...
PASSED
1,100
standard input
2 seconds
The first line contains a positive integer n (1 ≀ n ≀ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≀ ai ≀ 109), the number of answer variants to question i.
["2", "5", "10"]
#include <stdio.h> int main() { int n,i,a; long long res = 0; scanf("%d",&n); for(i=0;i<n;++i) { scanf("%d",&a); res += (a-1)*(long long)(i+1) + 1; } printf("%I64d\n",res); return 0; }
The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to qu...
Print a single number β€” the minimal number of clicks needed to pass the test it the worst-case scenario. Please do not use the %lld specificator to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specificator.
C
c8531b2ab93993b2c3467595ad0679c5
42436abcb1cb0677471cfcf1ad880ff1
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "greedy", "math" ]
1312714800
["2\n1 1", "2\n2 2", "1\n10"]
NoteNote to the second sample. In the worst-case scenario you will need five clicks: the first click selects the first variant to the first question, this answer turns out to be wrong. the second click selects the second variant to the first question, it proves correct and we move on to the second question; the thi...
PASSED
1,100
standard input
2 seconds
The first line contains a positive integer n (1 ≀ n ≀ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≀ ai ≀ 109), the number of answer variants to question i.
["2", "5", "10"]
#include<stdio.h> int main() { long long n,m,i,s=0; scanf("%I64d",&n); for(i=0;i<n;i++) { scanf("%I64d",&m); s+=(((m-1)*(i+1))+1); } printf("%I64d\n",s); return 0; }
The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to qu...
Print a single number β€” the minimal number of clicks needed to pass the test it the worst-case scenario. Please do not use the %lld specificator to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specificator.
C
c8531b2ab93993b2c3467595ad0679c5
bc4db74b89e46ad5098925385aff0cd0
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "greedy", "math" ]
1312714800
["2\n1 1", "2\n2 2", "1\n10"]
NoteNote to the second sample. In the worst-case scenario you will need five clicks: the first click selects the first variant to the first question, this answer turns out to be wrong. the second click selects the second variant to the first question, it proves correct and we move on to the second question; the thi...
PASSED
1,100
standard input
2 seconds
The first line contains a positive integer n (1 ≀ n ≀ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≀ ai ≀ 109), the number of answer variants to question i.
["2", "5", "10"]
#include <stdio.h> int main() { long long int n, i, a[101], ans; scanf("%lld", &n); for(i=0; i<n; i++) scanf("%lld", &a[i]); ans=a[0]; for(i=1; i<n; i++) ans+=(a[i]+(a[i]-1)*i); printf("%lld", ans); return 0; }
The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to qu...
Print a single number β€” the minimal number of clicks needed to pass the test it the worst-case scenario. Please do not use the %lld specificator to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specificator.
C
c8531b2ab93993b2c3467595ad0679c5
136dd50eefc9a34c3f27447cdb73ef75
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "greedy", "math" ]
1312714800
["2\n1 1", "2\n2 2", "1\n10"]
NoteNote to the second sample. In the worst-case scenario you will need five clicks: the first click selects the first variant to the first question, this answer turns out to be wrong. the second click selects the second variant to the first question, it proves correct and we move on to the second question; the thi...
PASSED
1,100
standard input
2 seconds
The first line contains a positive integer n (1 ≀ n ≀ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≀ ai ≀ 109), the number of answer variants to question i.
["2", "5", "10"]
#include<stdio.h> int main() { int i,n,m; scanf("%d",&n); m=n;i=0; long long int a[100],final=0; while(m--) { scanf("%lld",&a[i]); final=final+(a[i]-1)*(i+1)+1; // printf("%lu\n",final); i++; } printf("%lld\n",final); return 0; }
The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to qu...
Print a single number β€” the minimal number of clicks needed to pass the test it the worst-case scenario. Please do not use the %lld specificator to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specificator.
C
c8531b2ab93993b2c3467595ad0679c5
90b070dc0412281e917b72affa25a877
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "greedy", "math" ]
1312714800
["2\n1 1", "2\n2 2", "1\n10"]
NoteNote to the second sample. In the worst-case scenario you will need five clicks: the first click selects the first variant to the first question, this answer turns out to be wrong. the second click selects the second variant to the first question, it proves correct and we move on to the second question; the thi...
PASSED
1,100
standard input
2 seconds
The first line contains a positive integer n (1 ≀ n ≀ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≀ ai ≀ 109), the number of answer variants to question i.
["2", "5", "10"]
#include <stdio.h> main() { unsigned long long int n, a[101], w, i=1; scanf("%I64d", &n); w=n; L: if (i<=n) { scanf("%I64d", &a[i]); i++; goto L; } i=1; M: if (i<=n) { w=w+i*(a[i]-1); i++; ...
Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of remarkable properties. Help Rikhail to convince the scientific community in this!Let us remind you t...
If such maximum number exists, then print it. Otherwise, print "Palindromic tree is better than splay tree" (without the quotes).
C
e6e760164882b9e194a17663625be27d
2a237a0ce1b53ac20f880ffb23fa180d
GNU C11
standard output
256 megabytes
train_000.jsonl
[ "implementation", "number theory", "brute force", "math" ]
1439224200
["1 1", "1 42", "6 4"]
null
PASSED
1,600
standard input
3 seconds
The input consists of two positive integers p, q, the numerator and denominator of the fraction that is the value of AΒ (,Β ).
["40", "1", "172"]
/* practice with Dukkha */ #include <stdio.h> #define N 1179858 int dd[8]; int palin(int n) { int k, i, j; k = 0; while (n > 0) { dd[k++] = n % 10; n /= 10; } for (i = 0, j = k - 1; i < j; i++, j--) if (dd[i] != dd[j]) return 0; return 1; } int main() { static int kk[N + 1], ll[N + 1]; int p, q, n...
Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of remarkable properties. Help Rikhail to convince the scientific community in this!Let us remind you t...
If such maximum number exists, then print it. Otherwise, print "Palindromic tree is better than splay tree" (without the quotes).
C
e6e760164882b9e194a17663625be27d
517d273da334fa7214ff630ea099eba8
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation", "number theory", "brute force", "math" ]
1439224200
["1 1", "1 42", "6 4"]
null
PASSED
1,600
standard input
3 seconds
The input consists of two positive integers p, q, the numerator and denominator of the fraction that is the value of AΒ (,Β ).
["40", "1", "172"]
#include<stdio.h> //typedef int lld; int arr[2000010],prime[2000010],palin[2000010]; int main() {int p,q; //int arr[1000010]; //int prime[1000010]; int check[10]; int i; int count=0; int k; int j; for(i=1;i<2000010;i++) arr[i]=i; arr[1]=-1; for(i=2;i<2000010;i++) {if(arr[i]!=-1) {for(j=2*i;j<2000010...
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
C
09f5623c3717c9d360334500b198d8e0
9619fcda6f163eca5d091b3aa821196d
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1380295800
["3\n3 2 2", "4\n2 2 2 2"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
PASSED
1,600
standard input
2 seconds
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
["4", "3"]
#include<stdio.h> int a[100005]; int main() { __int64 n,t,sum,mx; int i; sum=0; mx=0; scanf("%I64d",&n); for(i=0;i<n;i++) { scanf("%I64d",&a[i]); sum+=a[i]; if(a[i]>mx) { mx=a[i]; } } if(sum%(n-1)==0) { if(mx...
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
C
09f5623c3717c9d360334500b198d8e0
099c52f94e97da14df9b6e4665591db9
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1380295800
["3\n3 2 2", "4\n2 2 2 2"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
PASSED
1,600
standard input
2 seconds
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
["4", "3"]
#include <stdio.h> int n; long long a[100010]; int check(long long ans) { int i; long long tot = 0; for (i = 1; i <= n; i++) { tot += (ans - a[i]); } if (tot >= ans) return 0; else return 1; } int main() { int i; long long max = 0, sum = 0, l, r, mid; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%...
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
C
09f5623c3717c9d360334500b198d8e0
9b8aa289c0f2dd7e14f93f594a6a6658
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1380295800
["3\n3 2 2", "4\n2 2 2 2"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
PASSED
1,600
standard input
2 seconds
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
["4", "3"]
#include <stdio.h> int main() { long long int n,x,i; scanf("%lld",&n); long long int max=0,rem=0; for(i=0;i<n;i++) { scanf("%lld",&x); rem = rem + x; if(max<x) max=x; } long long int ans = rem/(n-1) + (rem%(n-1)==0?0:1); if(max<ans) printf("%lld\n",ans); else printf("%lld\n",max); return 0; } ...
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
C
09f5623c3717c9d360334500b198d8e0
1cebf1a74eb1264b49f268dcfb24b065
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1380295800
["3\n3 2 2", "4\n2 2 2 2"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
PASSED
1,600
standard input
2 seconds
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
["4", "3"]
#include <stdio.h> #include <stdlib.h> long long w[100000]; int cmp(const void *ap, const void *bp) { long long a = *((long long *) ap); long long b = *((long long *) bp); if(a == b) return 0; return (a > b) ? 1 : -1; } int main() { int n; register int i; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
3349988814d8813089e07eff753b6fcb
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #define MAX 100 main() { int n,P,Q,R,T,S,l[MAX],r[MAX],i,res=0,a,b; scanf("%d %d %d %d %d %d",&n,&P,&Q,&R,&T,&S); for(i=1;i<=n;i++) { scanf("%d %d",&l[i],&r[i]); res+=(P*(r[i]-l[i])); } if(n>1) { for(i=2;i<=n;i++) { a=l[i]-r[i-1]...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
4f4b65d12c2332949ae8a34d1ab307ae
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> main() { int n,p1,p2,p3,t1,t2,i,l,r,x,y; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); x = 0; for (i=0;i<n;i++) { scanf("%d%d",&l,&r); x = x + (p1 * (r - l)); if (0<i) ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
c2d869b459ef49225c91f32ecc3df6fd
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> int main() { int n, p1, p2, p3, t1, t2, *l, *r; int i, sum = 0; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); l = malloc(sizeof(*l) * n); r = malloc(sizeof(*r) * n); for (i = 0; i < n; i++) { scanf("%d%d", &l[i], &r[i]); sum += (r[i] - l[i]) * p1; } for (i = 1;...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
7cd41194998c968a8ff7bd4a4e07b409
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,i,j; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); int rr=-1; int ans=0; while(n--) { int l,r; scanf("%d%d",&l,&r); ans+=(r-l)*p1; if(rr!=-1) { int d=l-rr; if(d<t1)ans+=d*p1; else if(d<t1+t2)ans+=t1*p1+(d-t1)*p2; el...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
62bc350e26161cda8aa2c5950653cad6
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main() { int n,p1,p2,p3,t1,t2; scanf("%d %d %d %d %d %d\n",&n,&p1,&p2,&p3,&t1,&t2); int l,r; scanf("%d %d",&l,&r); int c=(r-l)*p1; while (--n) { int or=r; scanf("%d %d",&l,&r); c+=(r-l)*p1; if (l-or<t1) c+=(l-or)*p1; else { c+=t1*p1; if (l-or-t1<t2) c+=(l-or-t1)*p2; else...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
3664a93b214e492f02c8d89e7380ebf5
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main() { int n, p1, p2, p3, t1, t2, l1, l2, r1, r2, a, b, c; long int total=0; scanf("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2); if(n==1){ scanf("%d %d", &l1, &r1); } else { scanf("%d %d", &l1, &r1); for(c=1;c<=n-1;c++){ scanf...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a45819e2cfffb6bb3b43320fcb84fe1e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<stdlib.h> struct interval{ int start; int end; }*period; int main(void){ int n,normal,saver,sleep,t1,t2,i,j,total=0,between; scanf("%d %d %d %d %d %d",&n,&normal,&saver,&sleep,&t1,&t2); period=(struct interval *)calloc(n,sizeof(struct interval)); for(i=0;i<n;i++) scanf("%d %d",&...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
943f4620bc186c4738cfcdf883502b24
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main(int argc, char *argv[]) { int p1, p2, p3, t1, t2, n, lr, l, r, e = 0; scanf("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2); scanf("%d %d", &l, &r); e += (r - l) * p1; lr = r; while(-- n) { scanf("%d %d", &l, &r); e += (r - l) * p1; if(l - lr <= t1) e += (l - lr) * p...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
f65d24c200843e2c7513a6a373c3d9fb
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,sum=0,i,j,k,a,b,c,test; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); scanf("%d %d",&i,&j); sum=sum+((j-i)*p1); for(test=1;test<n;test++){ scanf("%d %d",&a,&b); sum=sum+((b-a)*p1); k=a-j; if(k>t1){ s...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a5ec524ea77b4493a3c5fe7ef10387c4
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> int main() { int p1, p2, p3, t1, t2, n; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); { int i; int sum = 0; int rp = -1; for (i = 0; i < n; ++i) { int l, r; scanf("%d%d", &l, &r); ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
772efcc9204125a263ed69b227f86f68
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main () { int n, p1, p2, p3, t1, t2; scanf ("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2); int l[100], r[100]; for (int i = 0; i < n; i++) scanf ("%d %d", &l[i], &r[i]); int total_power = (r[0] - l[0]) * p1; for (int i = 1; i < n; i++) { int gap,...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
22d8d5e1a7ac88df88fcb6898cde2d01
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,i,a,b,x,consume=0; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); for(i=1;i<=n;i++){ scanf("%d %d",&a,&b); if(i>1){ if(a-x>=t1){ consume+=t1*p1; if(a-x-t1>=t2) consume+=(t2*p2)+(a-x-t1-t2...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
f5f77c92aefe4ed428665acfbb4509de
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> int main() { long int sumP = 0; long int n, PN, PSS,PS, TSS, TS, delT, li, ri, lip1, rip1, i; scanf("%ld %ld %ld %ld %ld %ld", &n, &PN, &PSS, &PS, &TSS, &TS); scanf("%ld %ld", &li, &ri); sumP += (ri-li)*PN; for(i = 1; i < n; i++){ scanf("%ld %ld", ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a4c63bb8bf01bd2fef645fabc8f8fa5a
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int ans=0,i,j,k,n,p1,p2,p3,t1,t2; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); int a[n],b[n]; for(i=0;i<n;i++) scanf("%d %d",&a[i],&b[i]); for(i=0;i<n;i++) { j=b[i]-a[i]; ans=ans+j*p1; } for(i=1;i<n;i++) { k=a[i]-b[i-1]; if(k<=t1) ans=ans+k*p1; else if(k<=(t...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
77ce0ccd2d4f4a0a9006e1e72473076f
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int w[1500]; int main() { int n, p1, p2, p3, t1, t2, x, l, r, e, L, R, i, j; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); for (i = 0; i < n; i++) { scanf("%d%d", &l, &r); l++; if (i == 0) L...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
16db86dd4f4753d1f68c2400d0d53923
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int i,n,p1,p2,p3,t1,t2; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); int sum=0,arr[n][2]; for(i=0;i<n;i++) { scanf("%d %d",&arr[i][1],&arr[i][2]); } for(i=0;i<n;i++) { sum=(sum+(arr[i][2]-arr[i][1])*p1); if(n>(i+1)) { if((arr[i+1][1]-arr[i][2])>=t1) { sum=sum+(t1*p1); if(arr[i+1][1...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
5ef1e2efd6b021c262c256650726f5df
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); int sum=0,i,a,b,k; for(i=0;i<n;i++) {scanf("%d%d",&a,&b); if(i==0) {sum=(b-a)*p1; k=b;} else {if(a-k<=t1) sum=sum+p1*(a-k)+(b-a)*p1; else if(a-k>t1 && a-k<=t1+t2) sum=sum+...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
2529c80a7889f83e8e8c7b0c13d30993
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> int main() { long long int i,n,p1,p2,p3,interval,normal,save,super_save,previous,sum=0; long long int x,y,t1,t2,tem; scanf("%lld %lld %lld %lld %lld %lld",&n,&p1,&p2,&p3,&t1,&t2); for(i=0;i<n;i++) { scanf("%lld %ll...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
8873a69350c22cca7cc5a1883dbfa7e5
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main(void) { int n, i; int P1, P2, P3, T1, T2; scanf("%d%d%d%d%d%d", &n, &P1, &P2, &P3, &T1, &T2 ); int prev = 0, ans = 0; for (i = 0; i < n; i ++) { int l, r, R; scanf("%d%d", &l, &r); ans += P1*(r-l); if (prev != 0) { R = l - prev...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
50e88bae4bff63daceb01019fb861e00
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); int i,range[2*n]; for(i=0;i<n*2;i++) { scanf("%d",&range[i]); } int total1=0,total2=0,total3=0; for(i=0;i<2*n;i+=2) { total1+=range[i+1]-range[i]; } int time; for(i=1;i<2*n-1;i+=2) { time = range[i+1]...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
0ee5f644935dda5380c24c9e7736d873
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<stdlib.h> #include<math.h> #define REP(i,a,b) for(i=a;i<b;i++) #define rep(i,n) REP(i,0,n) int main(){ int i,j,k,l,m,n; int T1,T2,P1,P2,P3; int a[120], b[120], res=0; scanf("%d%d%d%d%d%d",&n,&P1,&P2,&P3,&T1,&T2); rep(i,n) scanf("%d%d",a+i,b+i); rep(i,n){ res += (b[i]-a[i])*...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
732a68768f11efffbc801e21e3017b85
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n, p1, p2, p3, t1, t2, sum = 0, i, a, b, c; scanf("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2); scanf("%d %d", &a, &b); sum += p1*(b - a); c = b; for(i = 1; i < n; i++) { scanf("%d %d", &a, &b); sum += p1 * (b - a); if(t1 >= (a ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a0f4571bcbca7c160de29bae6e231c19
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #define max(a, b) ((a > b) ? a : b) #define min(a, b) ((a < b) ? a : b) int main() { int n, p1, p2, p3, t1, t2; scanf("%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2); int t = 0, power = 0; int i; for(i = 0; i < n; i++) { int l, r; scanf("%d %d", &l, &r); if(i == 0) { t = l; } // count l1...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
bfe67e702fae28749b8031dc1105c6a7
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> struct interval { int l; int r; }; main() { int n,p1,p2,p3,t1,t2,i,j,power; struct interval time[105]; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); for(i=0;i<n;i++) scanf("%d %d",&time[i].l,&time[i].r); power=(time[0].r-time[0].l)*p1; for(i...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
3738f37d2b7ad76b3e49a5b7229a9760
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main(void) { int n , p1, p2, p3, t1, t2; int i, j, l0, r0, l = 0, r = 0, sum = 0; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); scanf("%d%d", &l0, &r0); for (i = 1; i < n; i ++) { sum += (r0-l0)*p1; scanf("%d%d", &l, &r); if (l-r0 >= t1+t2) { sum += p1...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
f448c40ab90b89b2ebf87027e23f9097
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <math.h> int main(){ int n,P1,P2,P3,T1,T2,d=0,s,i,j; scanf("%d%d%d%d%d%d",&n,&P1,&P2,&P3,&T1,&T2); int arr[n][2]; for(i=0;i<n;i++){ for(j=0;j<2;j++){ scanf("%d",&arr[i][j]); }} for(i=0;i<n;i++){ d=d+(arr[i][1]-arr[i][0])*P1; } ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
00285579847c890787fecf38c0219ca2
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,i,j,k; long long ans=0; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); int A[n][2]; for(i=0;i<n;i++) { scanf("%d%d",&A[i][0],&A[i][1]); ans+=(A[i][1]-A[i][0])*p1; if(i>0) { j=A[i][0]-A[i-1][1]; ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
d54a00ca01e49b427243772ec74fc99e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,l[101],r[101],x; int power=0,i; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); for(i=0;i<n;i++) scanf("%d%d",&l[i],&r[i]); for(i=0;i<n-1;i++) {power+=((r[i]-l[i])*p1); x=l[i+1]-r[i]; if(x<=t1) power+=(x*p1); else if(x<=t1+t2) {power+=(t1*p1); power+=((x...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
58ffe1f04f6eea146fb285c213738304
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,c=0; int i,j,m,r,l,t,sum=0; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); int arr[n][2]; r=t1+t2; for ( i=0 ; i<n ; i++) { scanf("%d%d",&arr[i][0],&arr[i][1]); } for ( i=0 ; i<n ; i++) { m = arr[i][1]-arr[i][0...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
65b93354d9cc465646e234dacd08a91e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main(){ int n, p1, p2, p3, t1, t2; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); int i, a, b, ans = 0, last; scanf("%d%d", &a, &b); ans += (b-a) * p1; last = b; for(i = 1; i < n; ++i){ scanf("%d%d", &a, &b); if(a-last >= t1+t2){ ans += t...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
2bc6f1fce12f194a1697405a65491def
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> int main() { int n,p1,p2,p3,t1,t2,p=0; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); int a[n][2],i; for(i=0;i<=n-1;i++) { scanf("%d %d", &a[i][0] , &a[i][1]); } for(i=0;i<=n-1;i++) { p+=(a[i][1]-a[i][0])*p1; if(i<=n-2&&a[i+1][0]-...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
98ced2c3e5051678e4e14645a673ba5c
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> struct aa { int start; int end; }time[101]; int main() { int n,p1,p2,p3,t1,t2; while(scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2)!=-1) { for(int i=0;i<n;i++) scanf("%d%d",&time[i].start,&time[i].end); int p,sum; sum=0; p=-1; for(int i=0;i<n;i++) { if(p!=-1) { int dt=time[...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
0e585365083febd87bc087d0b696f113
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> main() { //freopen( "input.dat", "r", stdin ); int i, o, p, j, k, l, n, m; int p1, p2, p3, t1, t2; int x, y, yy; int output = 0; scanf( "%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2 ); scanf( "%d %d", &x, &y ); output += (y-x) * p1; for (i=2;i<=n;++i) { yy = y; sc...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
bd29a4ef85880dc051616d8e1fb91237
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n,p1,p2,p3,t1,t2,a,b,i,lr=0,power=0; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); scanf("%d %d",&a,&b); power+=(b-a)*p1; lr=b; for(i=1;i<n;i++) { scanf("%d %d",&a,&b); power+=(b-a)*p1; ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a0da1280853fda706175031cbadffed9
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> int main() { int n=0,p1=0,p2=0,p3=0,t1=0,t2=0,li=0,ri=0,l1=0,r1=0; int k=1,diff ; scanf("%d",&n); scanf("%d",&p1); scanf("%d",&p2); scanf("%d",&p3); scanf("%d",&t1); scanf("%d",&t2); int a=0,b=0,s; scanf("%d",&l1); scanf("%d",...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
44a65a55ffdbacf2c764ce257ef0334e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main() { int n,a,b,c,d,e,i,j,s,w,f; scanf("%d %d %d %d %d %d",&n,&a,&b,&c,&d,&e); int ara[1000][1000]; for (i=0;i<n;i++){ for (j=0;j<2;j++){ scanf("%d",&ara[i][j]); } } s=0; for (i=0;i<n;i++){ s=s+(ara[i][1]-ara[i][0])*a; } f=0; for (i=0;i<n-1;i++){ if ((d+e)<=(ara[i+1][0]...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
b91d38fa96362c48b5fa7f2f78d25e38
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <stdlib.h> struct period{int start; int end;}; struct period shift[1000]; int calcu(int n,int p1,int p2,int p3,int t1,int t2); int main() { int n,p1,p2,p3,t1,t2; int counter; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); for(counter=0;counter<n;counter++) { ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
0d46a0272d4aeb8922bb9dd6bafcf279
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int i,j,k,l,m,n,t=0,a[200],b,c; scanf("%d%d%d%d%d%d",&n,&i,&j,&k,&l,&m); for(b=0;b<(2*n);b+=2) { scanf("%d%d",&a[b],&a[b+1]); t+=(a[b+1]-a[b])*i;} for(b=2;b<(2*n);b+=2) { ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
8a411189a1ca6e09a3a9030f1ddf43e7
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n; int w[100],p1,p2,p3,t1,t2; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); int i,time,power=0,power1=0;; int l[1440],r[1440]; scanf("%d %d",&l[0],&r[0]); power+=((r[0]-l[0])*p1); for(i=1;i<n;i++) { scanf("%d %d",&l[i],&r[i]); power+=((r[i]-l[i])*p1); time=l[i]-r[i...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
f6485ca92e4f2ff1abbf3c158d7178aa
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main(){ int n, p1, p2, p3, t1, t2, prev = 0, l, r, res = 0; scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2); while(n--){ scanf("%d%d", &l, &r); if(!prev){ prev = l; } res += (r-l)*p1; if(l-prev <= t1){ res += (l-prev)*p1; } else if(l-prev <= t1+t2...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
a228020a40af58a4a7f9283481c4f5ab
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int a[128][2]; int n; int main() { int ret=0,i,j,p1,p2,p3,t1,t2; scanf("%d %d %d %d %d %d",&n,&p1,&p2,&p3,&t1,&t2); for(i=0;i<n;i++) scanf("%d %d",&a[i][0],&a[i][1]); for(i=a[0][0],j=0;i<a[n-1][1];i++) { if (i<a[j][1]) ret+=p1; else if (i>=a[j+1][0]) j++, ret+=p1; else if (i-a[j][1]>=t1+t...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
557f5fe333be214d1705b5b236528baf
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> int main() { int n,p1,p2,p3,t1,t2,st,end,i,end_last,ans,time; ans=0; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); for(i=0;i<n;i++) { if(i==0) { scanf("%d%d",&st,&end); ans+=(end-st)*p1; end_last=end; } else ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
3017a2e68feae763382fb0e08765ea15
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<string.h> int main() { int i,j,k,l,m,n,m1,m2,ans=0,t; int p1,p2,p3,t1,t2,n1; scanf("%d %d %d %d %d %d",&t,&p1,&p2,&p3,&t1,&t2); scanf("%d %d",&m,&n); ans+=(n-m)*p1; m1=m;n1=n; for(i=1;i<t;i++) { scanf("%d %d",&m,&n); ans+=(n-m)*p1; ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
dc8f91eeab2a2a66259b5d55b17769b2
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int n, P1, P2, P3, T1, T2; int a[200][2]; int i,j,k,l; int tmp,tmp1,tmp2,tmp3,next,sum; scanf("%d%d%d%d%d%d",&n,&P1,&P2,&P3,&T1,&T2); for(i=0;i<n;i++) scanf("%d%d",&a[i][0],&a[i][1]); sum=0;tmp1=0;tmp2=0;tmp3=0;ne...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
beffd27ebc80bc899862bf51b6c0e1f8
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> #include <string.h> #include <stdlib.h> int main () { int N, P1, P2, P3, T1, T2; scanf("%d %d %d %d %d %d",&N,&P1,&P2,&P3,&T1,&T2); int x1, y1, x2, y2; scanf("%d %d",&x1,&y1); int res = (y1 - x1) * P1; int i; for (i = 1; i < N; i++) { scanf("%d %d",&x2,&y2); ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
ad86d6954ceeb7af88d8d0ccb3957986
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include<stdio.h> #include<stdlib.h> int main() { int n,p1,p2,p3,t1,t2,a,c,b,e,i,d=0; long int p=0; scanf("%d%d%d%d%d%d",&n,&p1,&p2,&p3,&t1,&t2); scanf("%d %d",&a,&b); if(n==1) p=(b-a)*p1; else { p=(b-a)*p1; for(i=1;i<n;i++){ scanf("%d %d",&c,&e); ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
8f9e2d28b2088572655fbd17d254db4f
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main() { int n, P1, P2, P3, T1, T2; scanf("%d%d%d%d%d%d", &n, &P1, &P2, &P3, &T1, &T2); int i,a[210]; int sum = 0; for (i = 0; i <= n - 1; i++) { scanf("%d %d", &a[i * 2], &a[i * 2 + 1]); sum += (a[i * 2 + 1] - a[i * 2])*P1; } for (i = 1; i <= n-1; i++) { int d = a[i * 2] - a[i * ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
258236c9d6188175471cb216dde3dc75
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
#include <stdio.h> int main( void ) { int n, p1, p2, p3, t1, t2, t3; int i; int start, end, total, prev; scanf( "%d %d %d %d %d %d", &n, &p1, &p2, &p3, &t1, &t2 ); t3= t1 + t2; scanf( "%d %d", &start, &end ); prev = end; total = 0; total += ( end - start ) * p1; for ( i = ...
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
Output the answer to the problem.
C
7ed9265b56ef6244f95a7a663f7860dd
5408662e5ab96545d63921fcc6ee432b
GNU C
standard output
256 megabytes
train_000.jsonl
[ "implementation" ]
1271346300
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
null
PASSED
900
standard input
1 second
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
["30", "570"]
main(n,a){int b,c,d,e,l,r,t,x;scanf("%u%u%u%u%u%u",&n,&a,&b,&c,&d,&e);c-=b;b-=a;e+=d;t=1e4;x=0;while(n--){scanf("%u%u",&l,&r);x+=a*(r-l);l-=t;t=r;x+=a*(l>0)*l+b*(l>d)*(l-d)+c*(l>e)*(l-e);}return!printf("%u",x);}
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
C
ea7f8bd397f80ba7d3add6f9609dcc4a
68bec609b8b098c5e8e86672c040f386
GNU C
standard output
512 megabytes
train_000.jsonl
[ "combinatorics", "divide and conquer" ]
1396798800
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
PASSED
2,100
standard input
4 seconds
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
["0\n6\n6\n0", "0\n1\n0"]
#include <stdio.h> #include <string.h> #define N 20 #define ll __int64 ll a[(1 << N) + 1],aux[(1 << N) +1]; ll sum [N + 1][2]; ll LowerBound(ll a[],ll low, ll high ,ll value){ ll l, h,pos; l = low; h = high; pos = low - 1; while(l <= h) { ll mid = (l + h) >> 1; if (value > a[mid]) { l = mid + 1; pos =...
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
C
ea7f8bd397f80ba7d3add6f9609dcc4a
a23acca927bec122b5cd902daa1b9c38
GNU C
standard output
512 megabytes
train_000.jsonl
[ "combinatorics", "divide and conquer" ]
1396798800
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
PASSED
2,100
standard input
4 seconds
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
["0\n6\n6\n0", "0\n1\n0"]
#include <stdio.h> int n,m,q,num[1100000]; int tmp[1100000]; long long v[25][3]; short flag[25]; long long work(int l,int r,int d) { int i,ll,rr,mid = (l+r)>>1; long long a,b,c; if(!d) return 0; v[d][2] += (c=work(l,mid,d-1)+work(mid+1,r,d-1)); for(i=ll=l,rr=mid+1,b=0;i<=r;i++) { if(ll>mid || rr<=r && num[rr]<=...
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
C
ea7f8bd397f80ba7d3add6f9609dcc4a
1b2ef44d927c0e9171b9c2125598a704
GNU C
standard output
512 megabytes
train_000.jsonl
[ "combinatorics", "divide and conquer" ]
1396798800
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
PASSED
2,100
standard input
4 seconds
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
["0\n6\n6\n0", "0\n1\n0"]
#include<stdio.h> inline int get_ui(); int get_ui() { char c; for (; (c = getchar()) < '0' || c > '9';); for (int a = c ^'0';; a = (a * 10) + (c ^ '0')) if ((c = getchar()) < '0' || c > '9') return a; } #define maxN 20 #define maxN2 1 << maxN int data_fwd[maxN2], data_rev[maxN2], data_buf[maxN2], xlat[m...
Recently an official statement of the world Olympic Committee said that the Olympic Winter Games 2030 will be held in Tomsk. The city officials decided to prepare for the Olympics thoroughly and to build all the necessary Olympic facilities as early as possible. First, a biathlon track will be built.To construct a biat...
In a single line of the output print four positive integers β€” the number of the row and the number of the column of the upper left corner and the number of the row and the number of the column of the lower right corner of the rectangle that is chosen for the track.
C
667d00cac98b3bd07fc7c78be5373fb5
523927bdbd47ca3980295b9628a17663
GNU C
standard output
256 megabytes
train_000.jsonl
[ "dp", "constructive algorithms", "data structures", "binary search", "brute force" ]
1398409200
["6 7 48\n3 6 2\n5 4 8 3 3 7 9\n4 1 6 8 7 1 1\n1 6 4 6 4 8 6\n7 2 6 1 6 9 4\n1 9 8 6 3 9 2\n4 5 6 8 4 3 7"]
null
PASSED
2,300
standard input
4.5 seconds
The first line of the input contains three integers n, m and t (3 ≀ n, m ≀ 300, 1 ≀ t ≀ 109) β€” the sizes of the land plot and the desired distance covering time. The second line also contains three integers tp, tu and td (1 ≀ tp, tu, td ≀ 100) β€” the time the average biathlete needs to cover a flat piece of the track, a...
["4 3 6 7"]
#include <stdio.h> #include <stdlib.h> #define INF 100000000000LL #define lli long long int int land[305][305]; lli hl[305][305]; lli vd[305][305]; lli hr[305][305]; lli vu[305][305]; int bi, bk, bj, bp; lli delta; void binary_search(int l, int r, int t, int i, int k, int j) { int mid; lli sum; mid = (...
Recently an official statement of the world Olympic Committee said that the Olympic Winter Games 2030 will be held in Tomsk. The city officials decided to prepare for the Olympics thoroughly and to build all the necessary Olympic facilities as early as possible. First, a biathlon track will be built.To construct a biat...
In a single line of the output print four positive integers β€” the number of the row and the number of the column of the upper left corner and the number of the row and the number of the column of the lower right corner of the rectangle that is chosen for the track.
C
667d00cac98b3bd07fc7c78be5373fb5
9dd73197b3360ac537f89cdfd525c982
GNU C
standard output
256 megabytes
train_000.jsonl
[ "dp", "constructive algorithms", "data structures", "binary search", "brute force" ]
1398409200
["6 7 48\n3 6 2\n5 4 8 3 3 7 9\n4 1 6 8 7 1 1\n1 6 4 6 4 8 6\n7 2 6 1 6 9 4\n1 9 8 6 3 9 2\n4 5 6 8 4 3 7"]
null
PASSED
2,300
standard input
4.5 seconds
The first line of the input contains three integers n, m and t (3 ≀ n, m ≀ 300, 1 ≀ t ≀ 109) β€” the sizes of the land plot and the desired distance covering time. The second line also contains three integers tp, tu and td (1 ≀ tp, tu, td ≀ 100) β€” the time the average biathlete needs to cover a flat piece of the track, a...
["4 3 6 7"]
#include <stdio.h> #include <stdlib.h> #define INF 100000000000LL #define lli long long int int land[305][305]; lli hl[305][305]; lli vd[305][305]; lli hr[305][305]; lli vu[305][305]; int dummy2; int bi, bk, bj, bp; lli delta; void binary_search(int l, int r, int t, int i, int k, int j) { int mid; lli sum;...
Recently an official statement of the world Olympic Committee said that the Olympic Winter Games 2030 will be held in Tomsk. The city officials decided to prepare for the Olympics thoroughly and to build all the necessary Olympic facilities as early as possible. First, a biathlon track will be built.To construct a biat...
In a single line of the output print four positive integers β€” the number of the row and the number of the column of the upper left corner and the number of the row and the number of the column of the lower right corner of the rectangle that is chosen for the track.
C
667d00cac98b3bd07fc7c78be5373fb5
258c58ea9b15f0485bc27b44a137784d
GNU C
standard output
256 megabytes
train_000.jsonl
[ "dp", "constructive algorithms", "data structures", "binary search", "brute force" ]
1398409200
["6 7 48\n3 6 2\n5 4 8 3 3 7 9\n4 1 6 8 7 1 1\n1 6 4 6 4 8 6\n7 2 6 1 6 9 4\n1 9 8 6 3 9 2\n4 5 6 8 4 3 7"]
null
PASSED
2,300
standard input
4.5 seconds
The first line of the input contains three integers n, m and t (3 ≀ n, m ≀ 300, 1 ≀ t ≀ 109) β€” the sizes of the land plot and the desired distance covering time. The second line also contains three integers tp, tu and td (1 ≀ tp, tu, td ≀ 100) β€” the time the average biathlete needs to cover a flat piece of the track, a...
["4 3 6 7"]
#include <stdio.h> #include <stdlib.h> #define INF 100000000000LL #define lli long long int int land[305][305]; lli hl[305][305]; lli vd[305][305]; lli hr[305][305]; lli vu[305][305]; int dummy; int bi, bk, bj, bp; lli delta; void binary_search(int l, int r, int t, int i, int k, int j) { int mid; lli sum; ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
e05be0d3de98d2756b17f077cd2b0a4d
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main(){ int i,n,sum=0,t,arr[105]; double s; scanf("%d%d",&n,&t); s=t; for(i=1;i<=n;i++){ scanf("%d",&arr[i]); s+=arr[i]; } s/=n; for(i=1;i<=n;i++) if((s-arr[i])<0){ printf("-1"); return 0; } for(i=1;i<=n;i++) printf("%f\n",s-arr[i]); return 0; }
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
8313990239082abf073bf116d1dc21a6
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { int a[110],b,n,i,j,k,sum=0,c=0; float br[110],sum1; scanf("%d %d",&n,&b); for(i=0;i<n;i++){ scanf("%d",&a[i]); sum=sum+a[i];} sum=sum+b; sum1=(float)sum/(float)n; for(i=0;i<n;i++) br[i]=(sum1-(float)a[i]); for(i=0;i<n;i++) { if(br[i]<0){ c++;break;} } ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
8051bdfcf6b2c7141015a6f1e04781f4
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { double k,b,a[100],sum=0,m,c=0; int i,n; scanf("%d%lf",&n,&b); for( i=0;i<n;i++) { scanf("%lf",&a[i]); sum+=a[i]; } k=(sum+b)/n; for( i=0;i<n;i++) { m=k-a[i]; if(m<0) { printf("-1"); c++; ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
391bc0e31382360f53edd41c4537c401
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { int i; float n,b,s=0.0; float c[100]; scanf("%f%f",&n,&b); for(i=0;i<n;i++) { scanf("%f",&c[i]); s+=c[i]; } b=(b+s)/n; for(i=0;i<n;i++) { if (b<c[i]){printf("-1");return(0);} c[i]=b-c[i]; } for(i=0;i<n;i++) printf("%.6f\n",c[i]); return(0); }
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
7a13223f7ba0bf3993821730537c7a25
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> void main() { int i; double n,b,c,max,m[101],a[101]; while(scanf("%lf%lf",&n,&b)!=EOF) { max=0; c=b; for(i=0;i<n;i++) { scanf("%lf",&m[i]); if(m[i]>max) max=m[i]; c=c+m[i]; } c=c/n; ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
acf0352df3c1850da28edbebc8b7582e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #define MAXN 105 int n, b; int a[MAXN], max_a = 0, sum_a = 0; int main() { int i; scanf("%d%d", &n, &b); for (i = 0 ; i < n; ++i) { scanf("%d", &a[i]); if (max_a < a[i]) max_a = a[i]; sum_a += a[i]; } if (b < max_a * n - sum_a) puts("-1"); else { ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
b0a65098557d817ee9c596b555bdca27
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> #include<stdlib.h> int main() { int n,b,i,s=0,f=0; double avg; scanf("%d%d",&n,&b); int *a=(int *)calloc(n,sizeof(int)); for(i=0;i<n;i++) { scanf("%d",&a[i]); s=s+a[i]; } avg=((double)(s+b))/n; for(i=0;i<n;i++) { if(a[i]>avg) { f=...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
c57ebd31e2760be62f5109c4f308402c
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { int n,b,i,c=0;double s=0.0,t; scanf("%d%d",&n,&b); (double)n; (double)b; int a[n]; for(i=0;i<n;i++) { scanf("%d",&a[i]); (double)a[i]; s=s+a[i]; } t=(s+b)/n; for(i=0;i<n;i++) { if((t-a[i])<0) {printf("-1"); c++; break;} } if(c==0) { for(i=0;i...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
9a143fa00c569de19f46ebb23bce6364
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
main() { float b,s=0; int n,i; float k; scanf("%d %f",&n,&b); float a[n],c[n]; for(i=0;i<n;i++) { scanf("%f",&a[i]); s+=a[i]; } k=(float)((s+b)/n); for(i=0;i<n;i++){ if((k-a[i])>=0) c[i]=(float) k-a[i]; else{ printf("-1");return 0;}} for(i=0;i<n;i++) printf("%.6f\n",c[i]); return 0; }
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
ae483b3ac7663a565a5fc95f3cdffacc
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> #include<stdlib.h> int main(void){ int b,n,i; double *mug,all=0,ave; scanf("%d %d",&n,&b); mug=(double *)calloc(n,sizeof(double)); for(i=0;i<n;i++) scanf("%lf",mug+i); all+=b; for(i=0;i<n;i++) all+=*(mug+i); ave=all/n; for(i=0;i<n;i++){ *(mug+i)=ave-*(mug+i); if(*(mug+i)<0...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
214b321fc9c82991889dc1143e3ce32c
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #include <stdlib.h> int main() { int n,b,i,t=0; scanf("%d%d",&n,&b); float a[n],sum; for(i=0,sum=0;i<n;++i) { scanf("%f",&a[i]); sum+=a[i]; } sum+=b; float c[n],nkol; nkol=sum/(float)n; if(b>0) { for(i=0;i<n;++i) { c[i]=nkol...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
18e5776061b92ce421944269361d2bfe
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main(){ int n , k; scanf("%d %d", &n, &k); int i,a[n],s = 0,max = -1; for(i = 0; i < n; i++) { scanf("%d", &a[i]); s += a[i]; if(max < a[i]) max = a[i]; } s += k; double x = (1.0 * s)/n; if(max > x) {printf("-1\n"); return 0;} for(i = 0; i < n; i++) printf("%.6...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
9a0442e58bc3b303de8882afb6a0e49e
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> #include<stdlib.h> int main(void){ int b,i,n,sum,count=0,error=-1; int *a; double ave; scanf("%d %d",&n,&b); a=(int *)calloc(n,sizeof(int)); sum=0; for(i=0;i<n;i++){ scanf("%d",(a+i)); sum+=*(a+i); } sum+=b; ave=(double)sum/n; //printf("%f\n",ave); for(i=0;i<n;i++){ ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
fe1ec92de7e543082ad23660bc3ecc28
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> int a[100]; int main(int argc, char *argv[]) { int n, i, s, m; double b; scanf("%d %lf", &n, &b); for(i = 0; i < n; i ++) scanf("%d", a + i); s = 0; m = a[0]; for(i = 1; i < n; i ++) if(a[i] > m) { s += i * (a[i] - m); m = a[i]; } else s += m - a[i]; if(b < s) { ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
d9a423a4093d6890f0f867255c09a5a4
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #include <conio.h> #include <math.h> #include <string.h> #include <ctype.h> int main (void){ int i,x,j,temp,f=0,max; float b,n; scanf("%f %f",&n,&b); x=n; int c[x]; float need[x]; for(i=0;i<n;i++){ scanf("%d",&c[i]); need[i]=0; } max=c[0]; for(i...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
c0a6fda8b716ee0455591abe0d00d4ed
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { int n,i; double b; while(scanf("%d",&n)!=EOF) { double a[101]={0},sum,ave,res[101]; int flag=1; scanf("%lf",&b); sum=b; for(i=0;i<n;i++) { scanf("%lf",a+i); sum+=a[i]; } ave=sum/n; for(i=0;i<n;i++) { if(a[i]>ave) { flag=0; break; } res[i]=...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
dbd09161b3d97ae257f987b3b675f3d5
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { double rs,sy,a[102],max,ave; int i; while(scanf("%lf%lf",&rs,&sy)!=EOF) { max=-1; for(i=1;i<=rs;i++) { scanf("%lf",&a[i]); if(a[i]>max) max=a[i]; sy=sy+a[i]; } ave=sy/rs; if(ave<max) printf("-1\n"); else { for(i=1;i<=rs;i++) printf("%lf\n",ave-a...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
105dd56564d97148a5c7737f0637ceec
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #include <stdlib.h> int main(void) { int n, b, i, t=0; scanf("%d%d", &n, &b); float a[n], sum; for (i = 0, sum = 0; i < n; ++i) { scanf("%f",&a[i]); sum+=a[i]; } sum += (float)b; float c[n], nkol; nkol = sum / (float)n; if (b > 0) { for (i = 0; i < n; ++i) { ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
ee53a7f982cb65ef8164f04916d8f250
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #define in scanf #define out printf int main() { char n, i, b, a[100]; float c[100], full, t; in("%hhd %hhd", &n, &b); for (i = 0; i < n; ++i) in("%hhd", a+i); full = b; for (i = 0; i < n; ++i) full += a[i]; full /= n; for (i = 0; i < n; ++i) if (a[i] > full) break; else t = ful...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
8f8ec738f103d5e4c0db1b425f077609
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
main() { float b,s=0; int n,i; float k; scanf("%d %f",&n,&b); float a[n],c[n]; for(i=0;i<n;i++) { scanf("%f",&a[i]); s+=a[i]; } k=(float)((s+b)/n); for(i=0;i<n;i++){ if((k-a[i])>=0) c[i]=(float) k-a[i]; else{ printf("-1");return 0;}} for(i=0;i<n;i++) printf("%.6f\n",c[i]); return 0; }
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
cc628fde8c4946317319a2e11beb35d9
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char** argv) { int n, b; scanf("%d %d", &n, &b); double arr[n]; double in_cap = 0; int i; for (i = 0; i < n; i++) { scanf("%lf", &arr[i]); in_cap += arr[i]; } /* if (in_cap > b) { ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
f5ac436912dd6052e6d6caad0676294a
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> #include<math.h> int main() { int n,max=0,i; float b; scanf("%d %f",&n,&b); int a[100]; for(i=0;i<n;i++) { scanf("%d",&a[i]); max=max>a[i]?max:a[i]; } for(i=0;i<n;i++) { a[i]=max-a[i]; b-=a[i]; } if(b<0) { printf("-1"); return 0; } b/=n; for(i=0;i<n;i++) printf("%.6f\n",a[i]+b); return 0; }
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
1db5c4ef63725d43d2676f64a4065190
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int main() { long long n; long long int b; long long int a[105]={0}; long long int max=0; int i=0; max=0; double sum=0; scanf("%lld %lld",&n,&b); for(i=0;i<n;i++) { scanf("%lld",&a[i]); sum+=a[i]; if(a[i]>max) max=a[i]; } double ans=0; if(max*n>b+s...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
9c6fa0cd6cf968bf16bd5d59cd7ddc28
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> int main() { int n,a[105],sum,flag=1,i; double b[105],s=0; scanf("%d%d",&n,&sum); for(i=0;i<n;i++) { scanf("%d",&a[i]); s+=a[i]; } s+=sum; s=s/n; for(i=0;i<n;i++) { b[i]=s-a[i]; if(b[i]<0) { flag=0; ...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
d6eddb917c4b80a2237eab79af1dcb45
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int n; double a[110],b,max=-1.0,need=0.0; int main() { int i; scanf("%d %lf",&n,&b); for (i=0;i<n;i++) { scanf("%lf",a+i); if (a[i]>max) { max=a[i]; } } for (i=0;i<n;i++) { need+=max-a[i]; } if (need>b) { printf("-1\n"); } else { for (i=0;i<n;i++) { printf("%.8f\n",max-a[i]...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
62849084e0abedc8c08fdcca53e8deb7
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include <stdio.h> #include <stdlib.h> int main() { int n,b,a[10000],i,s=0; double q; scanf("%d %d", &n,&b); for(i=1;i<=n;i++) { scanf("%d", &a[i]); s+=a[i]; } a[n+1] = 0; q = (double)(s+b)/n; for(i=1;i<=n+1;i++) { if (q-a[i]<0) break; } if (i!=n+...
A group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of pouring Ber-Cola to everybody. Pouring the same amount of Ber-Cola to everybody is really important. In other words, the drink's volume in each of the n mugs must be the same.Polycarpus has already began the proce...
Print a single number "-1" (without the quotes), if there is no solution. Otherwise, print n float numbers c1, c2, ..., cn, where ci is the volume of the drink to add in the i-th mug. Print the numbers with no less than 6 digits after the decimal point, print each ci on a single line. Polycarpus proved that if a soluti...
C
65fea461d3caa5a932d1e2c13e99a59e
e182725e5d7c6c1fc23c3dbdfc34db25
GNU C
standard output
256 megabytes
train_000.jsonl
[ "math" ]
1333897500
["5 50\n1 2 3 4 5", "2 2\n1 100"]
null
PASSED
1,100
standard input
2 seconds
The first line contains a pair of integers n, b (2 ≀ n ≀ 100, 1 ≀ b ≀ 100), where n is the total number of friends in the group and b is the current volume of drink in the bottle. The second line contains a sequence of integers a1, a2, ..., an (0 ≀ ai ≀ 100), where ai is the current volume of drink in the i-th mug.
["12.000000\n11.000000\n10.000000\n9.000000\n8.000000", "-1"]
#include<stdio.h> int a[101], n, max = -1, i; double b, c[101]; int main() { scanf("%d %lf", &n, &b); for(i = 0; i < n; i++) { scanf("%d", &a[i]); if(a[i] > max) max = a[i]; } for(i = 0; i < n; i++) { if(a[i] < max) { c[i] = max - a[i]; ...