QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#294703#4829. Mark on a Graphucup-team112#0 1ms4112kbC++2012.8kb2023-12-30 15:56:382023-12-30 15:56:38

Judging History

你现在查看的是最新测评结果

  • [2023-12-30 15:56:38]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:4112kb
  • [2023-12-30 15:56:38]
  • 提交

answer

//#define _GLIBCXX_DEBUG

//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;


#ifdef LOCAL
#include <debug_print.hpp>
#define OUT(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define OUT(...) (static_cast<void>(0))
#endif

#define endl '\n'
#define lfs cout<<fixed<<setprecision(15)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using QP = priority_queue<T,vector<T>,greater<T>>;
template<typename T1, typename T2>bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T1,typename T2,typename T3>void anss(T1 x,T2 y,T3 z){ans(x!=y,x,z);};  
template<typename T>void debug(const T &v,ll h,ll w,string sv=" "){for(ll i=0;i<h;i++){cout<<v[i][0];for(ll j=1;j<w;j++)cout<<sv<<v[i][j];cout<<endl;}};
template<typename T>void debug(const T &v,ll n,string sv=" "){if(n!=0)cout<<v[0];for(ll i=1;i<n;i++)cout<<sv<<v[i];cout<<endl;};
template<typename T>void debug(const vector<T>&v){debug(v,v.size());}
template<typename T>void debug(const vector<vector<T>>&v){for(auto &vv:v)debug(vv,vv.size());}
template<typename T>void debug(stack<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(queue<T> st){while(!st.empty()){cout<<st.front()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(deque<T> st){while(!st.empty()){cout<<st.front()<<" ";st.pop_front();}cout<<endl;}
template<typename T>void debug(PQ<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(QP<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(const set<T>&v){for(auto z:v)cout<<z<<" ";cout<<endl;}
template<typename T>void debug(const multiset<T>&v){for(auto z:v)cout<<z<<" ";cout<<endl;}
template<typename T,size_t size>void debug(const array<T, size> &a){for(auto z:a)cout<<z<<" ";cout<<endl;}
template<typename T,typename V>void debug(const map<T,V>&v){for(auto z:v)cout<<"["<<z.first<<"]="<<z.second<<",";cout<<endl;}
template<typename T>vector<vector<T>>vec(ll x, ll y, T w){vector<vector<T>>v(x,vector<T>(y,w));return v;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<typename T1, typename T2>ostream &operator<<(ostream &os, const pair<T1, T2>&p){return os << "(" << p.first << "," << p.second << ")";}
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v){os<<"[";for(auto &z:v)os << z << ",";os<<"]"; return os;}
template<typename T>void rearrange(vector<int>&ord, vector<T>&v){
  auto tmp = v;
  for(int i=0;i<tmp.size();i++)v[i] = tmp[ord[i]];
}
template<typename Head, typename... Tail>void rearrange(vector<int>&ord,Head&& head, Tail&&... tail){
  rearrange(ord, head);
  rearrange(ord, tail...);
}
template<typename T> vector<int> ascend(const vector<T>&v){
  vector<int>ord(v.size());iota(ord.begin(),ord.end(),0);
  sort(ord.begin(),ord.end(),[&](int i,int j){return make_pair(v[i],i)<make_pair(v[j],j);});
  return ord;
}
template<typename T> vector<int> descend(const vector<T>&v){
  vector<int>ord(v.size());iota(ord.begin(),ord.end(),0);
  sort(ord.begin(),ord.end(),[&](int i,int j){return make_pair(v[i],-i)>make_pair(v[j],-j);});
  return ord;
}
template<typename T> vector<T> inv_perm(const vector<T>&ord){
  vector<T>inv(ord.size());
  for(int i=0;i<ord.size();i++)inv[ord[i]] = i;
  return inv;
}
ll FLOOR(ll n,ll div){assert(div>0);return n>=0?n/div:(n-div+1)/div;}
ll CEIL(ll n,ll div){assert(div>0);return n>=0?(n+div-1)/div:n/div;}
ll digitsum(ll n){ll ret=0;while(n){ret+=n%10;n/=10;}return ret;}
ll modulo(ll n,ll d){return (n%d+d)%d;};
template<typename T>T min(const vector<T>&v){return *min_element(v.begin(),v.end());}
template<typename T>T max(const vector<T>&v){return *max_element(v.begin(),v.end());}
template<typename T>T acc(const vector<T>&v){return accumulate(v.begin(),v.end(),T(0));};
template<typename T>T reverse(const T &v){return T(v.rbegin(),v.rend());};
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
int popcount(ll x){return __builtin_popcountll(x);};
int poplow(ll x){return __builtin_ctzll(x);};
int pophigh(ll x){return 63 - __builtin_clzll(x);};
template<typename T>T poll(queue<T> &q){auto ret=q.front();q.pop();return ret;};
template<typename T>T poll(priority_queue<T> &q){auto ret=q.top();q.pop();return ret;};
template<typename T>T poll(QP<T> &q){auto ret=q.top();q.pop();return ret;};
template<typename T>T poll(stack<T> &s){auto ret=s.top();s.pop();return ret;};
ll MULT(ll x,ll y){if(LLONG_MAX/x<=y)return LLONG_MAX;return x*y;}
ll POW2(ll x, ll k){ll ret=1,mul=x;while(k){if(mul==LLONG_MAX)return LLONG_MAX;if(k&1)ret=MULT(ret,mul);mul=MULT(mul,mul);k>>=1;}return ret;}
ll POW(ll x, ll k){ll ret=1;for(int i=0;i<k;i++){if(LLONG_MAX/x<=ret)return LLONG_MAX;ret*=x;}return ret;}
std::ostream &operator<<(std::ostream &dest, __int128_t value) {
  std::ostream::sentry s(dest);
  if (s) {
    __uint128_t tmp = value < 0 ? -value : value;
    char buffer[128];
    char *d = std::end(buffer);
    do {
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    } while (tmp != 0);
    if (value < 0) {
      --d;
      *d = '-';
    }
    int len = std::end(buffer) - d;
    if (dest.rdbuf()->sputn(d, len) != len) {
      dest.setstate(std::ios_base::badbit);
    }
  }
  return dest;
}
namespace converter{
  int dict[500];
  const string lower="abcdefghijklmnopqrstuvwxyz";
  const string upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  const string digit="0123456789";
  const string digit1="123456789";
  void regi_str(const string &t){
    for(int i=0;i<t.size();i++){
      dict[t[i]]=i;
    }
  }
  void regi_int(const string &t){
    for(int i=0;i<t.size();i++){
      dict[i]=t[i];
    }
  }
  vector<int>to_int(const string &s,const string &t){
    regi_str(t);
    vector<int>ret(s.size());
    for(int i=0;i<s.size();i++){
      ret[i]=dict[s[i]];
    }
    return ret;
  }
  vector<int>to_int(const string &s){
    auto t=s;
    sort(t.begin(),t.end());
    t.erase(unique(t.begin(),t.end()),t.end());
    return to_int(s,t);
  }
  
  vector<vector<int>>to_int(const vector<string>&s,const string &t){
    regi_str(t);
    vector<vector<int>>ret(s.size(),vector<int>(s[0].size()));
    for(int i=0;i<s.size();i++){
      for(int j=0;j<s[0].size();j++){
        ret[i][j]=dict[s[i][j]];
      }
    }
    return ret;
  }
  vector<vector<int>>to_int(const vector<string>&s){
    string t;
    for(int i=0;i<s.size();i++){
      t+=s[i];
    }
    sort(t.begin(),t.end());t.erase(unique(t.begin(),t.end()),t.end());
    return to_int(s,t);
  }
  string to_str(const vector<int>&s,const string &t){
    regi_int(t);
    string ret;
    for(auto z:s)ret+=dict[z];
    return ret;
  }
  vector<string> to_str(const vector<vector<int>>&s,const string &t){
    regi_int(t);
    vector<string>ret(s.size());
    for(int i=0;i<s.size();i++){
      for(auto z:s[i])ret[i]+=dict[z];
    }
    return ret;
  }
}
template< typename T = int >
struct edge {
  int to;
  T cost;
  int id;
  edge():to(-1),id(-1){};
  edge(int to, T cost = 1, int id = -1):to(to), cost(cost), id(id){}
  operator int() const { return to; }
};

template<typename T>
using Graph = vector<vector<edge<T>>>;
template<typename T>
Graph<T>revgraph(const Graph<T> &g){
  Graph<T>ret(g.size());
  for(int i=0;i<g.size();i++){
    for(auto e:g[i]){
      int to = e.to;
      e.to = i;
      ret[to].push_back(e);
    }
  }
  return ret;
}
template<typename T>
Graph<T> readGraph(int n,int m,int indexed=1,bool directed=false,bool weighted=false){
  Graph<T> ret(n);
  for(int es = 0; es < m; es++){
    int u,v;
    T w=1;
    cin>>u>>v;u-=indexed,v-=indexed;
    if(weighted)cin>>w;
    ret[u].emplace_back(v,w,es);
    if(!directed)ret[v].emplace_back(u,w,es);
  }
  return ret;
}
template<typename T>
Graph<T> readParent(int n,int indexed=1,bool directed=true){
  Graph<T>ret(n);
  for(int i=1;i<n;i++){
    int p;cin>>p;
    p-=indexed;
    ret[p].emplace_back(i);
    if(!directed)ret[i].emplace_back(p);
  }
  return ret;
}
struct RandomNumberGenerator {
  mt19937_64 mt;

  RandomNumberGenerator() : mt(chrono::steady_clock::now().time_since_epoch().count()) {}
  RandomNumberGenerator(int x) : mt(x){
    cout<<"-----debug-----"<<endl;
  }
  ll operator()(ll a, ll b) { // [a, b)
    uniform_int_distribution< ll > dist(a, b - 1);
    return dist(mt);
  }

  ll operator()(ll b) { // [0, b)
    return (*this)(0, b);
  }
};
RandomNumberGenerator rng;

Graph<int>gen(ll n,ll m){
  set<pair<int,int>>st;
  Graph<int>g(n);
  while(m--){
    while(1){
      ll u=rng(0,n);
      ll v=rng(0,n);
      if(u==v)continue;
      if(st.count(minmax(u,v)))continue;
      g[u].EB(v);
      g[v].EB(u);
      st.insert(minmax(u,v));
      break;
    }
  }
  return g;
}
struct UnionFind {
  vector<ll> data;
  ll num;
  UnionFind(ll size) : data(size, -1) ,num(size){ }
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
	  num--;
    }
    return x != y;
  }
  bool find(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  ll size(int x) {
    return -data[root(x)];
  }
  vector<vector<int>>groups(){
    vector<vector<int>>ret(data.size());
    for(int i=0;i<data.size();i++){
      ret[root(i)].push_back(i);
    }
    return ret;
  }
  void print(){
    auto tmp=groups();
    for(int i=0;i<data.size();i++){
      if(!tmp[i].empty()){
        for(auto z:tmp[i])cout<<z<<",";
        cout<<endl;
      }
    }
  }
};
pair<vector<int>,ll> check_clique(Graph<int>g){
  int n=g.size();
  vector<vector<int>>adj(n);
  rep(i,0,n){
    for(auto to:g[i])adj[i].PB(to);
    sort(ALL(adj[i]));
  }
  ll mx=0;
  vector<int>rcv;
  rep(i,0,n){
    vector<int>p;
    auto dfs=[&](auto &&f,int v,ll val)->void {
      p.PB(v);
      OUT(p);
      if(p.size()>=6&&chmax(mx,val)){
        rcv=p;
        //OUT(rcv,mx,val,p);
        p.pop_back();
        return;
      }
      for(auto to:adj[v]){
        bool exist=false;
        for(auto z:p)if(z==to)exist=true;
        if(exist)continue;
        ll add=0;
        for(auto z:p){
          if(binary_search(ALL(adj[z]),to)){
            add++;
          }
        }
        f(f,to,val+add);
      }
      p.pop_back();
    };
    dfs(dfs,i,0);
  }
  return MP(rcv,mx);
}
map<ll,ll>tmp;
bool solve(int n,int m,Graph<int>&g,bool output=true){
  vector<int>deg(n);
  rep(i,0,n)deg[i]=g[i].size();
  auto ord=descend(deg);
  vector<vector<int>>adj(n);
  rep(i,0,n){
    for(auto to:g[i])adj[i].PB(to);
    sort(ALL(adj[i]));
  }
  vector<P>ret;
  rep(i,1,6){
    if(!binary_search(ALL(adj[ord[0]]),ord[i])){
      ret.EB(ord[0],ord[i]);
      g[ord[0]].EB(ord[i]);
      g[ord[i]].EB(ord[0]);
    }
  }
  if(!ret.empty()){
    if(output){
      cout<<"mark"<<endl;
      cout<<ret.size()<<endl;
      for(auto z:ret)cout<<z.fi+1 spa z.se+1<<endl;
    }
    return false;
  }
  else{
    if(output)cout<<"ok"<<endl;
    return true;
  }
}


int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  map<ll,ll>mp;
  int n,m;cin>>n>>m;
  ll one=0,two=0;
  rep(_,0,1){
    //auto g=gen(n,m);
    auto g=readGraph<int>(n,m);
    if(!solve(n,m,g,true))one++;
    //if(solve(n,m,g,false))two++;
  }
  //auto g=readGraph<int>(n,m);
  OUT(one,two);
  OUT(tmp);
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3908kb

input:

1000 3560
603 151
415 20
102 569
895 552
678 734
24 614
689 518
440 223
751 919
223 433
711 551
502 634
706 583
812 501
514 535
780 751
720 530
532 384
888 139
864 791
292 675
171 881
30 592
464 557
280 299
654 650
894 335
250 532
792 10
83 969
118 771
579 300
852 983
243 940
957 939
817 889
911 319...

output:

mark
5
310 733
310 139
310 252
310 494
310 937

input:

1000 3565
626 311
295 222
665 298
534 977
682 582
495 833
155 683
656 841
184 255
392 381
439 187
63 633
448 161
770 790
655 180
484 763
439 897
224 648
974 380
521 734
368 520
794 364
113 49
66 583
715 526
457 125
567 806
70 757
464 840
87 733
161 397
232 412
14 201
368 394
201 178
992 583
65 485
2...

output:

ok

result:

ok all right

Test #2:

score: 100
Accepted
time: 1ms
memory: 3796kb

input:

1000 2000
457 335
160 497
464 992
892 255
853 3
308 301
970 363
541 299
89 418
425 128
626 827
603 854
484 874
755 295
607 483
798 552
356 850
320 357
254 940
675 901
168 525
301 636
520 555
773 910
343 701
889 966
218 529
909 950
71 64
682 284
424 138
721 792
670 544
386 72
654 909
725 235
592 437
...

output:

mark
5
747 761
747 727
747 79
747 151
747 592

input:

1000 2005
711 181
320 426
386 503
377 826
97 233
792 231
1 993
440 112
532 381
81 879
505 764
37 6
935 217
424 667
252 673
751 756
178 529
731 827
689 39
764 431
683 435
763 804
727 755
904 500
999 663
53 985
564 74
863 90
543 99
25 858
528 673
411 674
705 758
569 980
414 78
164 502
633 94
50 924
51...

output:

ok

result:

ok all right

Test #3:

score: 100
Accepted
time: 1ms
memory: 3964kb

input:

1000 5000
449 632
597 26
701 322
249 190
411 770
666 596
989 995
112 861
445 818
544 659
24 680
739 593
344 439
193 932
600 526
574 869
216 918
716 793
259 686
555 993
255 578
659 271
328 524
729 672
39 771
241 866
27 790
417 109
56 403
338 299
387 232
280 306
589 794
833 419
900 802
54 697
539 807
...

output:

mark
5
869 202
869 350
869 396
869 539
869 566

input:

1000 5005
551 153
467 786
785 219
208 346
802 740
428 127
150 361
435 479
24 121
968 75
699 578
106 119
23 570
128 182
917 352
647 492
128 752
345 228
786 421
13 996
854 465
890 582
471 103
780 461
326 859
516 1
62 839
138 888
321 569
181 533
207 306
5 115
344 252
781 886
629 274
129 462
530 634
843...

output:

ok

result:

ok all right

Test #4:

score: 100
Accepted
time: 1ms
memory: 3864kb

input:

1000 3156
347 398
792 278
754 442
413 757
391 130
636 625
207 437
81 415
47 974
887 779
524 619
379 894
868 594
653 919
29 117
123 867
632 505
648 147
130 420
495 876
637 659
882 348
462 878
282 646
398 525
419 224
926 448
305 934
855 570
396 345
774 918
336 123
502 491
984 783
845 142
790 594
754 4...

output:

mark
4
115 418
115 222
115 422
115 757

input:

1000 3160
540 785
372 439
654 975
845 585
169 154
533 297
215 814
475 825
377 109
439 852
556 16
77 971
843 100
150 509
394 334
611 811
355 876
492 783
180 437
396 138
985 865
20 309
703 203
287 985
253 812
962 456
28 157
766 874
353 918
57 1000
696 310
811 609
1 668
127 255
760 125
702 517
161 741
...

output:

ok

result:

ok all right

Test #5:

score: 100
Accepted
time: 1ms
memory: 4036kb

input:

1000 3433
634 21
789 966
541 959
213 381
366 781
107 649
747 122
336 869
222 648
833 972
929 524
712 524
744 525
568 679
634 163
901 501
56 518
128 587
720 117
208 439
860 85
852 168
934 947
34 858
520 568
408 464
232 432
999 504
71 982
957 372
570 436
281 309
410 405
521 275
554 589
4 707
498 148
5...

output:

mark
4
797 631
797 75
797 432
797 119

input:

1000 3437
976 492
771 824
416 864
904 368
376 943
655 576
49 853
565 396
313 452
899 769
437 114
649 707
593 653
514 637
856 985
685 959
722 527
105 342
513 476
626 331
544 638
776 682
157 7
593 713
474 937
669 188
505 579
565 863
847 969
157 778
671 425
441 167
91 992
767 42
947 455
49 960
97 664
3...

output:

ok

result:

ok all right

Test #6:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

1000 3057
985 223
432 967
405 822
845 650
893 646
599 718
754 710
333 73
392 355
895 496
200 562
816 36
457 953
9 623
889 662
482 590
249 29
689 694
185 990
285 690
12 323
611 560
903 722
476 86
105 666
441 193
695 640
36 617
840 42
80 527
977 539
606 150
384 585
784 648
919 360
157 532
568 98
995 8...

output:

mark
5
393 134
393 617
393 919
393 958
393 31

input:

1000 3062
308 836
132 203
942 518
49 962
294 184
246 107
638 347
66 316
666 188
733 571
432 540
241 921
990 540
27 44
428 520
22 995
427 446
947 623
964 660
225 40
767 199
330 263
46 503
626 431
706 283
640 971
771 338
215 413
747 356
449 761
454 315
75 314
250 947
624 902
995 567
56 970
191 192
26 ...

output:

ok

result:

ok all right

Test #7:

score: 100
Accepted
time: 1ms
memory: 4028kb

input:

1000 3085
484 405
841 443
661 315
392 941
355 558
523 394
773 929
673 840
5 707
255 610
744 58
301 794
505 33
668 533
787 945
747 810
803 115
340 900
791 909
596 418
129 491
460 698
156 233
664 502
231 465
795 486
829 102
608 212
253 344
419 557
100 421
321 793
207 302
544 479
33 916
736 129
6 156
9...

output:

mark
4
581 807
581 305
581 877
581 888

input:

1000 3089
151 953
628 248
945 220
95 734
105 365
239 616
234 229
241 349
611 937
567 601
160 515
398 570
86 617
572 24
518 662
885 414
728 94
840 929
453 110
194 617
156 600
711 775
508 48
716 321
569 156
452 468
64 517
783 964
277 75
197 710
963 396
877 643
951 787
502 739
157 505
299 371
158 547
6...

output:

ok

result:

ok all right

Test #8:

score: 100
Accepted
time: 0ms
memory: 4060kb

input:

1000 4289
963 66
959 467
930 83
419 699
731 948
702 583
699 245
636 721
859 551
377 251
90 889
286 843
908 47
864 979
223 948
269 684
85 579
162 376
414 255
602 884
65 132
842 907
488 360
553 898
649 249
253 711
675 632
629 446
708 413
819 511
512 113
189 76
242 464
828 261
440 737
643 389
75 907
49...

output:

mark
5
611 622
611 632
611 783
611 963
611 198

input:

1000 4294
771 4
54 929
935 953
570 550
586 368
495 798
933 460
236 163
973 130
610 299
1 338
999 495
636 660
829 18
766 84
445 483
382 832
785 598
74 443
261 847
320 310
668 204
880 425
662 198
752 240
722 628
974 37
444 766
404 955
524 567
67 129
602 33
306 681
781 759
719 642
73 670
538 759
780 98...

output:

ok

result:

ok all right

Test #9:

score: 100
Accepted
time: 1ms
memory: 4084kb

input:

1000 4763
544 167
316 76
78 841
699 1
645 745
827 262
568 545
595 81
924 561
108 253
397 626
142 967
613 397
723 633
711 259
363 249
5 436
165 88
178 463
734 529
195 324
135 41
1000 136
215 967
371 638
588 753
542 909
633 106
537 852
111 232
303 500
892 461
868 300
772 667
40 172
956 575
613 163
933...

output:

mark
4
240 148
240 425
240 509
240 983

input:

1000 4767
450 710
910 74
852 415
624 453
189 429
320 806
262 360
368 338
623 435
701 469
647 910
907 42
40 446
466 428
991 141
500 241
35 644
857 161
426 979
440 717
730 70
202 90
311 604
912 94
526 37
10 429
623 875
968 640
156 592
148 37
432 938
596 843
914 729
13 530
950 907
757 251
455 314
159 9...

output:

ok

result:

ok all right

Test #10:

score: 100
Accepted
time: 1ms
memory: 4076kb

input:

1000 4250
747 446
769 425
773 753
217 298
217 4
514 774
752 3
905 857
532 410
224 250
367 33
29 541
809 996
76 960
25 603
532 600
518 304
546 95
735 413
312 476
83 534
157 62
170 836
668 976
244 557
972 860
828 170
975 468
677 714
800 170
530 191
216 930
242 728
318 505
269 162
579 963
769 822
171 4...

output:

mark
5
384 170
384 747
384 5
384 49
384 175

input:

1000 4255
239 864
703 85
233 565
835 554
218 598
590 999
652 193
9 466
378 512
83 855
128 210
512 152
207 979
736 805
600 242
847 8
346 404
394 524
600 888
185 482
27 147
373 920
55 728
545 339
31 999
902 388
984 296
404 735
377 959
344 270
989 578
848 898
133 174
770 398
622 425
385 94
579 726
240 ...

output:

ok

result:

ok all right

Test #11:

score: 100
Accepted
time: 1ms
memory: 4032kb

input:

1000 3336
161 745
81 702
879 347
452 553
809 32
359 925
984 783
558 366
611 89
948 530
565 496
123 348
534 986
991 511
322 407
6 878
20 897
188 150
527 440
487 333
218 572
597 575
308 684
50 780
900 451
763 785
210 682
964 992
811 537
537 167
320 133
523 899
629 732
435 281
826 405
868 567
201 858
2...

output:

mark
5
299 359
299 947
299 314
299 609
299 81

input:

1000 3341
163 836
885 514
788 458
161 104
266 447
62 338
621 59
164 413
648 432
757 34
909 958
519 348
757 820
367 293
413 105
991 540
860 74
29 119
213 502
503 925
268 989
660 533
153 420
171 997
608 975
762 502
493 289
818 82
370 812
285 185
932 30
236 148
791 72
766 858
465 356
245 984
568 921
33...

output:

ok

result:

ok all right

Test #12:

score: 100
Accepted
time: 1ms
memory: 4096kb

input:

1000 3482
910 881
481 989
349 262
963 679
970 752
651 210
86 339
724 310
765 410
118 619
662 351
568 148
292 61
136 385
997 772
210 735
816 310
698 649
581 313
414 280
92 872
965 925
35 930
813 29
617 210
854 940
486 479
412 644
660 623
126 85
664 327
459 165
266 113
108 206
686 660
918 536
173 366
...

output:

mark
4
213 333
213 963
213 8
213 127

input:

1000 3486
470 796
751 281
537 313
543 565
128 60
103 718
457 367
757 811
87 574
659 616
920 727
493 178
414 169
572 728
338 638
421 938
445 591
455 767
700 651
270 650
845 26
452 346
817 910
478 522
877 240
74 630
507 189
81 271
299 513
402 42
362 299
519 960
847 385
802 766
800 133
882 619
109 298
...

output:

ok

result:

ok all right

Test #13:

score: 100
Accepted
time: 1ms
memory: 3820kb

input:

1000 2141
358 723
692 581
753 295
864 391
984 462
525 271
508 897
739 537
124 933
577 499
863 37
279 622
361 605
454 951
527 837
1 224
641 404
479 220
931 126
182 719
464 451
805 452
529 800
292 689
17 320
728 790
967 41
412 752
276 535
643 636
611 56
802 414
861 603
857 722
1000 584
435 118
266 392...

output:

mark
5
588 442
588 478
588 607
588 790
588 985

input:

1000 2146
429 482
435 67
324 112
821 542
372 998
408 746
886 426
198 960
211 898
433 165
399 745
986 692
943 831
92 121
562 755
414 271
27 617
355 356
407 480
453 625
796 98
412 425
760 713
923 559
650 792
28 761
315 333
735 379
131 938
110 328
491 753
589 788
597 526
515 710
172 587
338 550
308 447...

output:

ok

result:

ok all right

Test #14:

score: 100
Accepted
time: 1ms
memory: 3920kb

input:

1000 2950
244 361
694 442
547 577
545 866
488 207
888 997
263 45
850 200
30 927
195 510
274 582
467 158
664 667
880 573
522 986
736 375
206 326
999 940
875 609
151 161
602 673
664 200
827 579
12 190
300 249
95 502
951 317
669 243
350 841
692 572
619 302
955 999
480 891
109 779
198 893
105 442
214 14...

output:

mark
5
572 54
572 91
572 159
572 1
572 154

input:

1000 2955
749 585
407 754
910 157
160 759
799 65
818 116
867 14
353 831
816 753
637 496
865 924
204 215
666 760
537 995
256 29
462 578
526 578
713 583
181 541
253 840
931 44
523 488
247 761
857 816
17 751
518 367
541 578
499 59
604 329
307 590
933 975
293 776
248 22
990 475
763 366
607 882
260 541
9...

output:

ok

result:

ok all right

Test #15:

score: 100
Accepted
time: 1ms
memory: 4040kb

input:

1000 2725
336 461
575 6
961 482
496 574
134 336
671 452
172 957
633 89
909 334
222 155
90 660
201 950
436 671
726 683
487 356
536 389
107 844
403 732
550 608
607 54
718 438
960 144
710 278
398 747
152 501
86 385
34 251
309 822
773 321
329 213
897 948
356 401
290 329
278 591
683 454
122 523
729 436
4...

output:

mark
5
160 401
160 76
160 110
160 186
160 203

input:

1000 2730
572 724
766 850
784 47
830 461
32 303
760 724
889 582
423 993
486 736
314 138
748 662
716 981
195 996
421 110
508 819
923 161
151 216
707 193
148 72
355 275
656 359
32 566
595 214
534 639
583 577
489 706
797 969
316 746
699 129
51 654
436 330
455 810
121 484
602 491
605 460
871 424
137 836...

output:

ok

result:

ok all right

Test #16:

score: 100
Accepted
time: 1ms
memory: 3860kb

input:

1000 2812
357 725
462 948
927 875
21 284
52 197
457 876
744 315
990 255
660 522
51 971
392 275
736 77
131 216
581 438
495 271
965 111
376 89
824 363
628 13
33 585
836 144
791 404
916 588
668 243
960 335
505 368
744 264
332 893
65 320
205 81
929 44
135 224
306 351
938 505
70 927
825 634
161 492
434 1...

output:

mark
4
187 828
187 895
187 909
187 87

input:

1000 2816
74 677
364 28
861 647
219 117
85 601
795 562
450 900
667 734
176 302
59 167
624 220
654 405
175 360
191 878
573 696
99 654
787 602
412 445
381 880
713 84
47 207
722 703
391 964
27 898
362 535
685 389
498 620
989 678
880 11
849 230
321 353
523 913
528 805
1000 921
450 262
190 214
89 674
863...

output:

ok

result:

ok all right

Test #17:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

1000 2616
518 38
164 144
301 140
711 11
36 636
443 779
107 901
467 922
759 675
229 276
467 880
975 435
382 460
238 663
639 927
74 953
777 326
689 944
152 237
501 789
795 889
95 376
390 401
279 64
520 803
273 292
333 454
202 485
860 54
872 641
101 951
236 726
464 847
992 656
576 565
739 176
562 327
2...

output:

mark
5
174 301
174 91
174 347
174 357
174 730

input:

1000 2621
669 76
738 584
934 815
281 256
323 538
928 12
993 942
80 324
373 709
789 477
256 233
15 565
960 465
820 846
45 588
947 939
959 552
728 892
102 949
490 891
853 545
224 152
696 138
258 787
922 833
193 690
308 184
715 740
280 718
768 710
921 775
81 20
819 950
946 36
162 750
274 789
363 154
57...

output:

ok

result:

ok all right

Test #18:

score: 100
Accepted
time: 1ms
memory: 3956kb

input:

1000 4792
659 787
666 143
711 116
742 958
604 434
293 882
175 28
557 753
106 808
527 599
942 249
843 109
174 76
429 255
415 489
463 540
878 235
688 87
629 402
927 418
704 734
886 463
702 992
570 370
492 865
795 889
638 594
887 203
732 896
610 492
960 422
44 255
442 448
426 697
862 351
318 277
783 22...

output:

mark
5
46 548
46 309
46 35
46 588
46 592

input:

1000 4797
933 88
411 170
173 260
316 598
786 70
772 373
770 586
340 412
196 69
888 956
413 6
633 903
631 615
697 232
307 397
372 887
53 406
107 475
448 100
735 622
733 188
723 769
43 172
963 447
326 527
863 650
144 117
163 850
550 618
476 304
30 904
555 158
328 849
849 96
923 120
959 950
526 246
454...

output:

ok

result:

ok all right

Test #19:

score: 100
Accepted
time: 1ms
memory: 4052kb

input:

1000 3724
513 194
958 159
936 285
493 34
668 957
824 152
450 421
92 170
416 782
546 100
698 433
299 741
261 975
661 408
4 927
789 856
52 784
541 618
99 780
527 957
618 74
440 321
839 496
360 484
71 21
149 302
25 505
240 587
584 736
490 934
817 867
682 287
882 528
985 852
201 46
254 112
862 582
379 3...

output:

mark
5
377 824
377 979
377 25
377 58
377 296

input:

1000 3729
297 476
522 181
334 574
414 22
782 667
81 818
264 317
470 217
722 860
892 697
22 514
147 696
917 911
188 673
362 717
975 360
124 740
745 921
406 99
505 489
968 216
462 956
584 350
37 90
156 521
718 460
938 950
864 752
928 749
224 563
664 578
624 823
301 968
197 906
223 739
530 636
641 788
...

output:

ok

result:

ok all right

Test #20:

score: 100
Accepted
time: 1ms
memory: 3916kb

input:

1000 4188
106 174
116 750
197 421
387 311
48 148
296 628
755 929
804 267
341 16
263 676
486 178
334 256
639 453
183 206
497 528
911 457
854 258
104 922
931 576
725 214
300 460
149 847
754 657
670 983
525 366
475 667
680 376
676 126
929 766
437 821
646 717
578 151
885 981
394 105
264 225
429 390
502 ...

output:

mark
5
262 654
262 148
262 758
262 158
262 877

input:

1000 4193
286 143
317 477
283 874
908 309
388 247
76 824
317 292
141 198
92 685
116 433
756 982
989 243
509 585
837 290
98 523
820 249
865 388
956 738
997 249
81 487
411 856
931 924
973 77
775 923
124 189
43 426
342 635
540 235
612 553
774 288
679 357
873 678
973 771
827 839
291 751
281 907
635 496
...

output:

ok

result:

ok all right

Test #21:

score: 100
Accepted
time: 1ms
memory: 3872kb

input:

1000 3236
622 762
548 197
457 126
655 978
275 215
472 112
762 998
649 242
890 339
337 1
169 283
365 486
584 324
988 887
406 500
62 591
512 839
76 251
479 635
485 217
961 204
934 8
621 40
374 227
1 403
644 72
758 370
436 494
174 341
770 80
421 125
151 211
405 389
514 637
808 815
131 762
647 518
804 7...

output:

mark
5
247 762
247 642
247 78
247 290
247 927

input:

1000 3241
797 855
898 823
211 449
697 612
517 389
40 423
603 249
127 894
862 736
543 716
131 22
124 414
748 956
326 741
583 966
825 472
488 299
705 839
547 110
321 303
788 325
481 85
24 53
952 611
616 287
547 602
542 767
542 289
95 353
107 983
394 330
975 69
37 392
835 991
204 509
796 917
738 813
43...

output:

ok

result:

ok all right

Test #22:

score: 100
Accepted
time: 1ms
memory: 3888kb

input:

1000 3299
693 455
906 758
704 271
639 392
910 445
984 43
821 447
3 475
929 500
879 29
243 657
602 744
974 96
879 79
225 9
868 993
115 636
701 248
995 83
781 441
995 320
766 534
432 827
65 632
873 392
231 943
502 170
856 584
368 665
391 797
734 568
538 613
539 984
505 285
965 253
446 107
605 681
216 ...

output:

mark
5
971 873
971 711
971 300
971 33
971 59

input:

1000 3304
906 373
12 741
985 701
569 78
295 723
395 484
549 427
361 662
313 856
548 508
751 357
148 595
17 91
951 199
318 710
381 319
633 131
34 51
628 118
382 567
960 778
136 674
333 735
209 294
26 759
242 352
452 987
993 550
177 819
358 391
650 308
1 407
69 655
185 961
845 613
260 691
603 263
732 ...

output:

ok

result:

ok all right

Test #23:

score: 100
Accepted
time: 1ms
memory: 4072kb

input:

1000 3482
45 265
363 58
385 372
365 256
659 227
700 636
954 356
708 312
24 144
103 367
797 394
779 615
596 57
546 439
622 318
344 724
27 792
286 475
286 469
581 321
191 79
457 80
357 577
559 587
63 234
982 665
838 402
931 320
724 796
645 275
254 812
283 710
75 269
991 914
888 557
214 416
316 465
197...

output:

mark
5
809 640
809 262
809 396
809 444
809 74

input:

1000 3487
186 427
612 15
660 891
102 538
141 959
491 936
693 679
201 864
48 605
816 584
651 325
969 971
951 649
719 41
8 670
873 585
308 779
334 272
468 589
430 198
615 811
919 809
299 929
407 912
478 428
513 630
333 726
889 953
146 237
682 443
737 540
104 230
853 472
97 775
616 329
573 460
376 572
...

output:

ok

result:

ok all right

Test #24:

score: 100
Accepted
time: 1ms
memory: 3964kb

input:

1000 2311
97 580
515 270
609 837
243 284
715 189
980 486
853 479
235 7
253 300
207 583
282 612
456 80
486 497
503 404
74 701
64 172
583 794
570 655
901 25
14 568
485 218
621 50
253 26
433 784
533 215
134 695
278 364
879 983
690 952
198 197
725 421
95 464
927 999
104 71
752 252
553 356
187 952
38 859...

output:

mark
5
294 532
294 659
294 738
294 7
294 37

input:

1000 2316
622 436
520 36
903 593
646 374
130 276
344 569
783 148
154 575
671 434
658 109
93 266
919 307
7 736
803 619
978 165
269 517
999 218
461 735
494 235
331 306
321 693
563 916
806 818
714 609
672 39
65 984
302 37
972 203
718 343
540 825
554 695
754 406
674 622
678 861
674 812
563 746
993 103
6...

output:

ok

result:

ok all right

Test #25:

score: 100
Accepted
time: 1ms
memory: 4036kb

input:

1000 3896
460 688
426 709
610 203
65 902
606 471
519 789
275 370
86 879
786 822
601 948
312 884
115 372
100 491
967 601
104 750
411 830
571 626
201 132
175 126
678 756
610 712
267 770
853 475
406 479
485 471
479 953
156 968
785 918
61 114
348 147
659 495
709 716
248 599
984 20
728 726
859 759
681 10...

output:

mark
4
65 224
65 706
65 708
65 275

input:

1000 3900
742 623
861 745
841 202
367 798
894 883
586 587
775 186
180 322
14 935
976 535
72 47
962 699
98 938
811 995
487 73
483 220
241 715
114 719
120 469
995 898
203 360
765 626
86 978
573 196
756 536
517 249
607 227
938 982
264 1
994 36
351 800
937 156
788 573
317 233
957 689
7 294
168 171
974 6...

output:

ok

result:

ok all right

Test #26:

score: 100
Accepted
time: 1ms
memory: 4112kb

input:

1000 3891
701 522
952 922
356 456
249 391
128 593
9 524
661 405
984 460
440 470
639 699
782 189
537 74
184 399
888 710
975 120
475 924
602 492
200 577
978 478
611 758
886 262
404 313
44 559
170 35
749 501
848 364
6 401
723 549
110 186
281 506
52 379
84 255
755 196
824 136
985 230
523 682
826 823
560...

output:

mark
5
519 307
519 465
519 451
519 214
519 379

input:

1000 3896
248 166
838 426
179 602
812 989
691 720
418 729
280 11
74 597
686 609
59 590
882 812
52 995
751 478
135 415
383 473
879 592
843 518
122 341
67 924
723 681
679 170
850 336
179 508
387 707
932 48
7 967
76 163
369 714
84 21
230 613
11 996
735 563
513 783
608 869
708 617
612 140
963 136
562 53...

output:

ok

result:

ok all right

Test #27:

score: 0
Wrong Answer
time: 1ms
memory: 4080kb

input:

1000 3265
924 167
3 999
663 583
890 496
619 193
641 842
720 966
650 470
975 552
309 965
968 739
223 474
41 188
279 73
663 940
438 173
385 280
113 178
896 270
15 956
456 196
291 323
392 622
180 781
469 950
685 672
633 436
562 153
407 796
209 630
750 874
190 614
400 306
560 935
235 777
500 785
378 332...

output:

mark
4
350 595
350 890
350 257
350 598

input:

1000 3269
838 599
989 282
540 789
346 913
917 492
462 117
629 202
879 615
60 429
894 675
724 250
425 901
714 571
637 113
452 810
692 254
870 886
504 567
479 505
398 814
608 411
281 162
79 963
673 498
748 622
396 128
828 478
188 491
948 693
165 834
719 928
553 283
192 485
653 305
576 556
648 531
401 ...

output:

mark
1
564 613

result:

wrong answer Token "mark" doesn't correspond to pattern "ok"