QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#196257 | #441. 制作菜品 | c20231020 | 100 ✓ | 663ms | 311612kb | C++23 | 10.0kb | 2023-10-01 14:52:02 | 2023-10-01 14:52:03 |
Judging History
answer
/*
膜拜传奇特级宗师 Afterglow 大神儿
今天在 florr 首页称您为大夏尊贵的大名儿
一股敬佩之情油生然而
您在 florr 为国争光,扬我大夏威名
向您献上最真挚的膜拜!!!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
*/
/*
_____ _____ _____ _____
/\ \ /\ \ /\ \ /\ \
/ \ \ / \ \ / \____\ / \ \
\ \ \ / \ \ / / / \ \ \
\ \ \ / \ \ / / / \ \ \
\ \ \ / /\ \ \ / /____/ \ \ \
\ \ \ / / \ \ \ / | | \ \ \
\ \ \ / / \ \ \ / | | \ \ \
\ \ \ / / / \ \ \ / | | \ \ \
\ \ \ / / / \ \ \ / |____|__ _____ \ \ \
_______________\ \____\/ /____/ \ \ \ / /| \ \ _______________\ \____\
\ / /\ \ \ \ \ \\ / | _________\____\\ / /
\ ____________/____/ \ \ \ \ \____\\/__| | | \ ____________/____/
\ \ \ \ \ \ | | | | | | \ \ \
\ \ \ \ \ \ | | | | | | \ \ \
\ \ \ \ \ \ | |____| | | | \ \ \
\ \ \ \ \ \ / / / \ | | \ \ \
\ \ \ \ \ \/ / / \ | | \ \ \
\ \____\ \ \___/ / / \ | | \ \____\
\ / / \ / / \| | \ / /
\/____/ \_______/____/ \____| \/____/
*/
#define poj
#define zcz
#ifdef poj
//C++
#include<iomanip>
#include<iostream>
//C
#include<cassert>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
//STL
#include<algorithm>
#include<bitset>
#include<functional>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
//C++11
#if __cplusplus>=201103L
#include<chrono>
#include<random>
#include<unordered_set>
#include<unordered_map>
#endif
#else
#include<bits/stdc++.h>
#endif
using namespace std;
#ifdef zcz
class fastin{
private:
#ifdef poj
static const int MAXBF=1<<20;
#else
const int MAXBF=1<<27;
#endif
FILE *inf;
char *inbuf,*inst,*ined;
inline char _getchar(){
if(inst==ined)inst=inbuf,ined=inbuf+fread(inbuf,1,MAXBF,inf);
return inst==ined?EOF:*inst++;
}
public:
fastin(FILE*_inf=stdin){
inbuf=new char[MAXBF],inf=_inf,inst=inbuf,ined=inbuf;
}
~fastin(){delete inbuf;}
template<typename Int> fastin&operator>>(Int &n){
static char c;
Int t=1;
while((c=_getchar())<'0'||c>'9')if(c=='-')t=-1;
n=(c^48);
while((c=_getchar())>='0'&&c<='9')n=n*10+(c^48);
n*=t;
return *this;
}
fastin&operator>>(char&c){
while((c=_getchar())<'!'||c>'~');
return *this;
}
fastin&operator>>(char*s){
int t=0;
static char c;
while((c=_getchar())==' '||c=='\n');
s[t++]=c;
while((c=_getchar())>='!'&&c<='~')s[t++]=c;
s[t]='\0';
return *this;
}
}fi;
class fastout{
private:
#ifdef poj
static const int MAXBF=1<<20;
#else
const int MAXBF=1<<27;
#endif
FILE *ouf;
char *oubuf,*oust,*oued;
inline void _flush(){fwrite(oubuf,1,oued-oust,ouf);oued=oust;}
inline void _putchar(char c){
if(oued==oust+MAXBF)_flush(),oued=oubuf;
*oued++=c;
#ifdef local
_flush();
#endif
}
public:
fastout(FILE*_ouf=stdout){
oubuf=new char[MAXBF],ouf=_ouf,oust=oubuf,oued=oubuf;
}
~fastout(){_flush();delete oubuf;}
template<typename Int> fastout&operator<<(Int n){
if(n<0)_putchar('-'),n=-n;
static char S[20];
int t=0;
do{S[t++]='0'+n%10,n/=10;}while(n);
for(int i=0;i<t;++i)_putchar(S[t-i-1]);
return *this;
}
fastout&operator<<(char c){_putchar(c);return *this;}
fastout&operator<<(char*s){
for(int i=0;s[i];++i)_putchar(s[i]);
return *this;
}
fastout&operator<<(const char*s){
for(int i=0;s[i];++i)_putchar(s[i]);
return *this;
}
}fo;
#define cin fi
#define cout fo
#else
#define czc ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#endif
#define mod7 1000000007
#define mod9 998244353
#define ll long long
#define isinf 0x3f3f3f3f
#define ilinf 0x7fffffff
#define lsinf 0x3f3f3f3f3f3f3f3f
#define llinf 0x7fffffffffffffff
#define pii pair<int,int>
#define fr first
#define sc second
#define next ___
#define pb push_back
#define N 500010
#define M 5000010
#define For(i,a,b) for(ll i=(a);i<=(b);++i)
#define Rep(i,a,b,c) for(ll i=(a);i<=(b);i+=c)
#define Per(i,a,b,c) for(ll i=(a);i>=(b);i-=c)
#define Gra(i) for(ll i=h[x];i;i=next[i])
typedef int arr[N];
typedef int arm[M];
typedef ll arl[N];
typedef ll alm[M];
typedef double ard[N];
typedef double adm[M];
namespace modint{
template<typename Int,Int mod,Int m1>
struct modint{
Int v;
modint(){v=0;}
modint(Int a){v=a;}
bool operator==(modint a){return v==a.v;}
bool operator!=(modint a){return v!=a.v;}
bool operator<(modint a){return v<a.v;}
bool operator>(modint a){return v>a.v;}
bool operator<=(modint a){return v<=a.v;}
bool operator>=(modint a){return v>=a.v;}
bool operator==(Int a){return v==a;}
bool operator!=(Int a){return v!=a;}
bool operator<(Int a){return v<a;}
bool operator>(Int a){return v>a;}
bool operator<=(Int a){return v<=a;}
bool operator>=(Int a){return v>=a;}
friend bool operator==(Int a,modint b){return b==a;}
friend bool operator!=(Int a,modint b){return b!=a;}
friend bool operator<(Int a,modint b){return b>a;}
friend bool operator>(Int a,modint b){return b<a;}
friend bool operator<=(Int a,modint b){return b>=a;}
friend bool operator>=(Int a,modint b){return b<=a;}
modint operator+(modint a){return v>=mod-a.v?v-mod+a.v:v+a.v;}
modint operator-(modint a){return v>=a.v?v-a.v:v+mod-a.v;}
modint modnum(modint a){
return a-((__int128(a.v)*m1)>>80)*mod;
}
modint operator*(modint a){return modnum(v*a.v);}
modint operator+=(modint a){*this=*this+a;return *this;}
modint operator-=(modint a){*this=*this-a;return *this;}
modint operator*=(modint a){*this=*this*a;return *this;}
modint qpow(modint a,Int b){
modint r(1);
for(;b;b>>=1,a*=a)if(b&1)r*=a;
return r;
}
modint operator/(modint a){return qpow(a,mod-2)*v;}
modint operator/=(modint a){*this=*this/a;return *this;}
modint&operator++(){*this=*this+1;return *this;}
modint&operator--(){*this=*this-1;return *this;}
const modint operator++(int){modint r=*this;++*this;return r;}
const modint operator--(int){modint r=*this;--*this;return r;}
friend modint operator+(Int a,modint b){return modint(a)+b;}
friend modint operator-(Int a,modint b){return modint(a)-b;}
friend modint operator*(Int a,modint b){return modint(a)*b;}
friend modint operator/(Int a,modint b){return modint(a)/b;}
#ifdef cout
friend fastin&operator>>(fastin&in,modint&n){in>>n.v;return in;}
friend fastout&operator<<(fastout&out,modint n){out<<n.v;return out;}
#else
friend istream&operator>>(istream&in,modint&n){in>>n.v;return in;}
friend ostream&operator<<(ostream&out,modint n){out<<n.v;return out;}
#endif
};
typedef modint<long long,1000000007,1208925811152148> int7;
typedef modint<long long,998244353,1211051999424262> int9;
}
using namespace modint;
int n,m,k,a[510],b[510],v[510];
set<pii>st;
vector<vector<int>>ans;
bitset<5000010>f[510];
void f1(){
ans.clear();
st.clear();
For(i,1,n){
st.insert({a[i],i});
}
if(m>=n){
For(i,1,m-n+1){
auto[x,y]=*st.rbegin();
ans.pb({y,k});
st.erase(--st.end());
st.insert({x-k,y});
}
}
For(i,1,n-1){
auto[x1,y1]=*st.begin();
auto[x2,y2]=*st.rbegin();
ans.pb({y1,x1,y2,k-x1});
st.erase(st.begin());
st.erase(--st.end());
st.insert({x2+x1-k,y2});
}
for(auto v:ans){
int F=1;
for(auto i:v){
if(!F)cout<<' ';
else F=0;
cout<<i;
}
cout<<'\n';
}
}
void f2(){
fill(v+1,v+1+n,0);
For(i,1,n){
b[i]=a[i]-k;
}
int r=m*k;
f[0].reset();
f[0][r]=1;
For(i,1,n){
f[i]=f[i-1]|(b[i]<0?(f[i-1]>>(-b[i])):(f[i-1]<<b[i]));
}
if(f[n][r-k]==0){
cout<<"-1\n";
return;
}
int pos=n,w=r-k;
while(pos){
if(f[pos-1][w-b[pos]]){
v[pos]=1;
w-=b[pos];
}
--pos;
}
ans.clear();
st.clear();
int p=0;
For(i,1,n){
if(v[i]){
st.insert({a[i],i});
++p;
}
}
For(i,1,p-1){
auto[x1,y1]=*st.begin();
auto[x2,y2]=*st.rbegin();
ans.pb({y1,x1,y2,k-x1});
st.erase(st.begin());
st.erase(--st.end());
st.insert({x2+x1-k,y2});
}
for(auto v:ans){
int F=1;
for(auto i:v){
if(!F)cout<<' ';
else F=0;
cout<<i;
}
cout<<'\n';
}
ans.clear();
st.clear();
p=0;
For(i,1,n){
if(!v[i]){
st.insert({a[i],i});
++p;
}
}
For(i,1,p-1){
auto[x1,y1]=*st.begin();
auto[x2,y2]=*st.rbegin();
ans.pb({y1,x1,y2,k-x1});
st.erase(st.begin());
st.erase(--st.end());
st.insert({x2+x1-k,y2});
}
for(auto v:ans){
int F=1;
for(auto i:v){
if(!F)cout<<' ';
else F=0;
cout<<i;
}
cout<<'\n';
}
}
void solve(){
cin>>n>>m>>k;
For(i,1,n)cin>>a[i];
if(m>=n-1)f1();
else f2();
return;
}
int main(){
#ifndef zcz
czc;
#endif
int t=1;cin>>t;
while(t--)solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 5
Accepted
time: 3ms
memory: 9524kb
input:
10 4 2 50 13 39 35 13 4 3 45 19 55 34 27 4 3 47 18 33 20 70 4 2 48 5 8 40 43 4 2 47 8 37 25 24 4 2 46 1 10 45 36 4 2 49 2 5 47 44 4 2 49 34 31 25 8 4 2 45 27 31 21 11 4 2 50 35 12 27 26
output:
-1 1 19 2 26 4 27 3 18 3 16 2 29 1 18 4 29 3 20 4 27 4 14 2 33 1 5 4 43 2 8 3 40 -1 2 10 4 36 1 1 3 45 2 5 4 44 1 2 3 47 -1 -1 -1
result:
ok OK both got answer: NYYYNYYNNN
Test #2:
score: 5
Accepted
time: 7ms
memory: 7804kb
input:
10 4 2 50 16 24 30 30 4 3 47 2 79 53 7 4 3 50 32 61 44 13 4 2 50 1 6 44 49 4 2 47 19 21 26 28 4 2 46 10 10 36 36 4 2 46 5 2 41 44 4 2 47 33 29 26 6 4 2 45 34 32 23 1 4 2 45 27 11 29 23
output:
-1 1 2 2 45 4 7 3 40 3 13 2 34 4 13 2 37 2 24 3 26 3 18 1 32 1 1 4 49 2 6 3 44 1 19 4 28 2 21 3 26 2 10 4 36 1 10 3 36 2 2 4 44 1 5 3 41 -1 -1 -1
result:
ok OK both got answer: NYYYYYYNNN
Test #3:
score: 5
Accepted
time: 6ms
memory: 8372kb
input:
10 4 2 50 30 24 22 24 4 4 49 27 2 82 85 4 3 48 25 7 58 54 4 2 49 7 2 42 47 4 2 48 24 17 29 26 4 2 47 5 2 42 45 4 2 47 1 5 46 42 4 2 49 41 27 13 17 4 2 45 32 38 1 19 4 2 48 2 37 27 30
output:
-1 4 49 2 2 3 47 1 27 4 22 4 14 3 35 2 7 3 41 3 17 4 31 4 23 1 25 2 2 4 47 1 7 3 42 -1 2 2 4 45 1 5 3 42 2 5 4 42 1 1 3 46 -1 -1 -1
result:
ok OK both got answer: NYYYNYYNNN
Test #4:
score: 5
Accepted
time: 9ms
memory: 13092kb
input:
10 10 8 5000 5342 2288 3662 4105 4769 3942 5355 3406 4746 2385 10 9 4698 1039 6862 6700 5529 5825 3904 2539 5303 3551 1030 10 10 4730 4387 531 7610 2566 236 4490 2510 8625 8084 8261 10 8 4806 1147 891 10 173 1046 1138 853 1176 11527 20487 10 8 4719 6495 10158 2542 2599 2552 2821 2521 2457 2778 2829 ...
output:
-1 10 1030 2 3668 1 1039 3 3659 7 2539 5 2159 3 3041 4 1657 2 3194 8 1504 9 3551 6 1147 6 2757 4 1941 4 1931 8 2767 8 1032 5 3666 8 4730 5 236 10 4494 2 531 9 4199 7 2510 3 2220 4 2566 3 2164 3 3226 6 1504 6 2986 1 1744 1 2643 8 2087 8 1808 9 2922 9 963 10 3767 3 10 10 4796 4 173 10 4633 5 1046 10 3...
result:
ok OK both got answer: NYYYYYYNNY
Test #5:
score: 5
Accepted
time: 11ms
memory: 12096kb
input:
10 10 8 5000 6157 6740 2393 3458 2043 1360 6248 1866 4221 5514 10 9 4538 2843 5424 4477 3285 6508 6308 1055 2505 3471 4966 10 10 4768 7647 4253 6258 1620 1896 5150 4265 7169 3108 6314 10 8 4530 203 386 695 553 454 907 161 138 7699 25044 10 8 4749 12629 3640 2377 2953 3034 2552 2594 2539 2971 2703 10...
output:
-1 7 1055 5 3483 8 2505 6 2033 1 2843 2 1695 5 3025 10 1513 4 3285 3 1253 3 3224 6 1314 6 2961 2 1577 2 2152 9 2386 9 1085 10 3453 1 4768 4 1620 8 3148 5 1896 10 2872 1 2879 3 1889 9 3108 6 1660 10 3442 3 1326 3 3043 7 1725 7 2540 2 2228 2 2025 8 2743 8 1278 6 3490 8 138 10 4392 7 161 10 4369 1 203 ...
result:
ok OK both got answer: NYYYNYYNNN
Test #6:
score: 5
Accepted
time: 2ms
memory: 3556kb
input:
10 500 499 5000 3843 636 8549 185 5830 892 8932 7825 5651 7620 6940 2405 7094 3940 1386 8882 8067 4484 5330 6806 6447 8253 1493 2867 4309 4942 2164 5890 4198 7743 7659 8054 8378 6352 8239 4353 7245 7315 2322 3040 5080 9262 5445 2318 3346 6831 1345 1557 1459 6674 8363 7906 5072 1 917 9381 4943 3081 5...
output:
54 1 141 4999 123 4 112 4996 210 20 348 4980 411 56 130 4944 458 60 468 4940 160 88 100 4912 71 143 262 4857 487 163 285 4837 248 180 353 4820 263 180 198 4820 4 185 221 4815 479 209 431 4791 287 311 65 4689 343 327 500 4673 390 329 467 4671 116 341 404 4659 166 408 306 4592 430 502 239 4498 164 506...
result:
ok OK both got answer: YYYYYYYYYY
Test #7:
score: 5
Accepted
time: 0ms
memory: 3560kb
input:
10 500 499 5000 6364 9285 10151 6902 4812 383 1398 4035 1971 9873 7569 5965 325 5298 1360 8638 1972 5110 4572 251 3205 9987 5918 5656 9501 10136 6777 5295 1349 9650 5545 7712 8543 5303 4221 2961 5686 5619 6996 7657 5099 4172 3229 5425 9470 4589 3669 1048 9699 8241 1300 2511 7835 7218 8167 6943 6961 ...
output:
372 57 152 4943 193 84 294 4916 255 149 267 4851 287 155 368 4845 361 211 143 4789 92 233 442 4767 120 242 138 4758 20 251 170 4749 137 257 204 4743 471 275 72 4725 265 298 3 4702 379 305 387 4695 13 325 26 4675 476 356 446 4644 237 360 348 4640 6 383 332 4617 450 383 277 4617 178 405 22 4595 312 42...
result:
ok OK both got answer: YYYYYYYYYY
Test #8:
score: 5
Accepted
time: 6ms
memory: 3776kb
input:
10 500 499 5000 3262 2165 5773 7999 8262 4733 3525 9726 2951 1150 7415 3911 8271 1083 1070 2438 5462 121 3183 3406 4427 604 9652 7737 3618 9228 586 3865 8022 5399 2492 1306 7564 8264 9304 5848 3019 2852 5597 5971 4002 3034 9882 2296 4117 974 4734 9579 1096 7917 3007 5522 8522 2682 3282 2162 1932 386...
output:
153 54 442 4946 430 63 60 4937 179 65 242 4935 213 80 301 4920 432 88 194 4912 189 92 451 4908 458 103 168 4897 347 109 291 4891 18 121 43 4879 336 145 409 4855 364 163 395 4837 461 166 109 4834 438 167 68 4833 254 206 352 4794 398 208 233 4792 351 228 92 4772 102 248 212 4752 279 292 75 4708 367 30...
result:
ok OK both got answer: YYYYYYYYYY
Test #9:
score: 5
Accepted
time: 4ms
memory: 3672kb
input:
10 500 499 5000 376 381 6759 4321 1893 4083 656 572 8961 7703 7497 2069 1181 1998 5786 6456 3949 5274 1870 1472 749 1478 8484 20 7946 3563 4574 2497 9538 6433 9457 9905 6814 6258 4268 8707 384 4925 9279 9345 2670 6818 1456 3851 8816 7242 349 2808 2558 2219 4280 3308 3697 2806 3327 1685 6369 7902 418...
output:
197 10 67 4990 24 20 65 4980 383 29 453 4971 170 31 299 4969 259 45 32 4955 92 49 360 4951 457 82 263 4918 257 100 470 4900 478 145 71 4855 462 181 143 4819 109 189 466 4811 66 208 87 4792 364 228 162 4772 230 236 235 4764 239 237 376 4763 243 245 346 4755 408 258 29 4742 47 349 248 4651 68 366 499 ...
result:
ok OK both got answer: YYYYYYYYYY
Test #10:
score: 5
Accepted
time: 26ms
memory: 22636kb
input:
10 25 23 5000 1582 1893 7547 6423 6090 3892 4873 4774 2419 2735 5981 2688 3103 6615 6641 5380 2563 5787 7635 7001 1653 7130 6048 1202 3345 25 4081 4766 1369984 261096 700757 803287 573341 1074135 738958 287371 722477 1506529 1248259 111432 430938 235065 1290857 961063 846904 1042705 718050 355187 15...
output:
24 1202 19 3798 21 1653 3 3347 2 1893 22 3107 9 2419 20 2581 17 2563 15 2437 12 2688 14 2312 10 2735 5 2265 25 3345 23 1655 5 3825 11 1175 19 3837 18 1163 22 4023 16 977 3 4200 7 800 7 4073 11 927 11 3879 8 1121 8 3653 18 1347 18 3277 20 1723 20 2697 16 2303 16 2100 23 2900 23 1493 14 3507 14 796 15...
result:
ok OK both got answer: YYYYYYYYYN
Test #11:
score: 5
Accepted
time: 33ms
memory: 21880kb
input:
10 25 1181 462 27553 24516 201 15428 23094 32388 21669 7407 32798 40696 20339 22360 33207 21199 22486 32400 30281 21768 20176 4462 2709 25794 34237 21829 6625 25 23 490 56 500 3 104 62 39 17 83 10 110 44 14 16 94 30 43 51 4 117 65 16 102 456 4806 4428 25 23 480 47 75 21 508 41 3 48 57 10 70 589 96 5...
output:
10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 10 462 23 462 10 462 23 462 10 462 23 462 10 462 13 462 23 462 10 462 9 462 13 462 16 462 23 462 6 462 10 462 9 462 13 462 16 462 23 462 6 462 10 462 9 462 13 462 16 462 23 462 6 462 10 462 9 462 13 462 16 462...
result:
ok OK both got answer: YYYYYYYYYN
Test #12:
score: 5
Accepted
time: 28ms
memory: 22044kb
input:
10 25 1996 459 42271 3951 22551 39538 47172 12207 69249 32050 23450 71343 14663 50987 57351 29133 43127 42623 60062 37544 15504 39007 49586 17876 2088 70962 21869 25 23 492 68 65 77 77 12 8 40 58 24 93 5 46 69 1 92 48 75 56 43 44 111 3 2 4572 5627 25 23 470 496 17 88 437 56 86 66 38 86 86 92 13 100 ...
output:
10 459 24 459 10 459 24 459 10 459 24 459 10 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 459 7 459 24 459 10 4...
result:
ok OK both got answer: YYYYYYYYYY
Test #13:
score: 5
Accepted
time: 55ms
memory: 30360kb
input:
10 40 2512 475 13292 14201 12975 71320 26633 55182 40472 7861 24905 21752 36640 22060 55829 23162 33190 44623 15134 24868 26316 10462 6520 35857 72022 31604 16527 10443 72278 20073 4676 30582 16987 17966 44783 29963 16708 71415 12567 57181 6699 37472 40 38 459 62 59 50 64 101 45 19 48 66 23 56 10 34...
output:
27 475 23 475 27 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36 475 27 475 4 475 23 475 36...
result:
ok OK both got answer: YYYYYYYYYN
Test #14:
score: 5
Accepted
time: 72ms
memory: 37412kb
input:
10 50 2076 493 13768 16083 2191 44149 4290 40590 31917 13314 17253 29746 38642 43320 35890 11453 39167 6759 4608 7908 24128 12150 47546 11145 21662 18819 6855 1750 32550 19098 14245 39372 8714 28012 7662 10904 24369 11953 3702 8493 25267 20955 38239 16116 16483 26336 27570 7857 33095 32177 15765 943...
output:
21 493 21 493 21 493 21 493 21 493 21 493 21 493 4 493 21 493 4 493 21 493 12 493 4 493 21 493 12 493 4 493 21 493 12 493 4 493 21 493 12 493 4 493 21 493 12 493 4 493 21 493 12 493 4 493 21 493 6 493 12 493 4 493 21 493 6 493 12 493 4 493 21 493 6 493 12 493 30 493 4 493 15 493 21 493 6 493 12 493 ...
result:
ok OK both got answer: YYYYYYYYYY
Test #15:
score: 5
Accepted
time: 116ms
memory: 55552kb
input:
10 80 78 5000 8040 5713 8368 9134 8571 8109 7586 4125 7300 8857 8252 4188 5699 4785 6890 1459 1717 1611 4490 4584 6110 8045 3749 9170 3825 7975 5314 8649 3411 305 4924 2083 6018 3925 1850 5222 2667 69 9347 600 8926 8232 4789 5258 3649 2312 6717 5367 3923 1840 584 665 518 4333 468 4342 2941 5782 3624...
output:
38 69 39 4931 30 305 24 4695 55 468 4 4532 53 518 41 4482 72 545 10 4455 51 584 28 4416 40 600 5 4400 52 665 62 4335 66 917 63 4083 69 986 3 4014 76 1087 42 3913 17 1717 6 3283 74 1795 22 3205 50 1840 1 3160 35 1850 80 3150 32 2083 26 2917 46 2312 67 2688 37 2667 70 2333 64 2739 7 2261 57 2941 9 205...
result:
ok OK both got answer: YYYYNYYYYY
Test #16:
score: 5
Accepted
time: 126ms
memory: 61684kb
input:
10 90 88 5000 5484 8888 12 5876 2700 2940 353 5052 3730 1150 3821 2601 3969 1124 6851 5536 493 6681 3568 7776 2861 4548 2986 6888 3620 7790 9415 3136 606 6329 2623 6092 5736 2634 2487 8436 5574 2840 4007 9305 3991 7828 2425 7960 8952 9276 4015 9445 6476 7583 7739 9337 2650 1244 6744 6271 9034 6678 9...
output:
85 28 48 4972 60 159 27 4841 83 171 59 4829 80 315 52 4685 7 353 84 4647 17 493 40 4507 79 525 46 4475 76 562 64 4438 29 606 88 4394 73 1091 57 3909 71 1100 45 3900 14 1124 2 3876 10 1150 66 3850 54 1244 78 3756 68 1277 36 3723 69 2098 82 2902 43 2425 67 2575 35 2487 44 2513 62 2549 42 2451 31 2623 ...
result:
ok OK both got answer: YYYYYYYYYY
Test #17:
score: 5
Accepted
time: 130ms
memory: 67932kb
input:
10 100 98 5000 8022 7712 6112 7663 1520 7578 2583 6276 5066 2892 9298 943 7244 2199 7090 5023 4145 2293 2574 1382 4442 5853 2144 4654 3331 2729 4068 7165 7453 7925 4978 5351 5506 959 2884 7027 8537 5467 3172 3473 8359 2340 4415 5473 4539 1375 365 8684 3668 2939 10066 8110 8792 2079 2633 1992 4807 67...
output:
66 234 70 4766 47 365 51 4635 34 959 64 4041 96 1092 78 3908 74 1128 75 3872 84 1236 11 3764 46 1375 59 3625 20 1382 53 3618 94 1543 48 3457 97 1776 37 3224 56 1992 41 3008 88 2063 52 2937 54 2079 1 2921 60 2130 30 2870 23 2144 92 2856 90 2254 95 2746 73 2280 4 2720 18 2293 63 2707 42 2340 100 2660 ...
result:
ok OK both got answer: YYYYYYYYYN
Test #18:
score: 5
Accepted
time: 407ms
memory: 189592kb
input:
10 300 298 5000 5030 5827 7011 8862 5150 6830 4727 2114 6063 4511 4362 9088 205 3225 1864 4129 7690 7517 1429 9553 5840 1890 1254 2099 7836 7291 3302 1049 9208 4207 2303 4386 173 9314 3387 5323 6283 8114 7436 2484 2764 1937 1711 2969 5163 3575 7098 2992 1231 8527 2684 7072 556 3938 9171 8392 1368 26...
output:
70 29 95 4971 133 52 256 4948 209 130 78 4870 244 143 296 4857 117 162 143 4838 152 171 207 4829 33 173 252 4827 259 173 100 4827 138 174 20 4826 195 219 266 4781 71 241 72 4759 79 260 59 4740 277 274 34 4726 119 307 264 4693 228 321 140 4679 112 326 122 4674 157 346 115 4654 105 349 150 4651 96 399...
result:
ok OK both got answer: YYYYYYYYYY
Test #19:
score: 5
Accepted
time: 556ms
memory: 250044kb
input:
10 400 398 5000 2279 4205 8320 5468 9047 6440 1995 3019 2232 1218 9740 2414 8351 9403 6770 8485 6427 2827 5318 2800 2239 8052 101 4435 7548 1757 2323 4880 899 209 4509 3183 4414 2567 8651 3200 9007 384 6218 977 1602 5697 3391 9954 4839 10161 8177 1005 2727 3234 3804 4966 1025 3906 9401 8573 5663 146...
output:
65 7 302 4993 87 40 394 4960 159 52 224 4948 324 59 301 4941 82 65 158 4935 23 101 152 4899 299 139 374 4861 234 146 165 4854 225 175 46 4825 30 209 72 4791 247 232 271 4768 223 233 341 4767 295 255 233 4745 191 285 248 4715 169 338 336 4662 38 384 71 4616 390 393 44 4607 312 432 389 4568 83 453 86 ...
result:
ok OK both got answer: YYYYYYYYYY
Test #20:
score: 5
Accepted
time: 663ms
memory: 311612kb
input:
10 500 498 5000 9985 2503 9725 1832 2649 714 9735 4079 8786 8366 10289 598 6536 5521 1487 2592 5197 8514 9590 6334 3817 4141 4407 7125 7338 1365 6816 9153 2880 6832 1744 2229 9336 833 4061 1349 1547 3160 5428 10333 890 5081 296 7426 10602 1783 10018 5163 10297 8971 861 3478 2476 5268 10603 9814 6633...
output:
323 11 166 4989 265 43 161 4957 177 48 354 4952 395 59 55 4941 433 64 45 4936 481 76 351 4924 125 105 98 4895 390 125 162 4875 447 125 163 4875 300 128 369 4872 135 134 437 4866 230 137 40 4863 282 223 471 4777 400 235 49 4765 176 236 380 4764 273 245 297 4755 114 256 458 4744 65 273 413 4727 383 28...
result:
ok OK both got answer: YYYYYYYYYY
Extra Test:
score: 0
Extra Test Passed