QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#76620#2562. Fake Plastic Trees 2SortingAC ✓16ms6796kbC++3.3kb2023-02-11 03:47:002023-02-11 03:47:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-11 03:47:04]
  • 评测
  • 测评结果:AC
  • 用时:16ms
  • 内存:6796kb
  • [2023-02-11 03:47:00]
  • 提交

answer

#include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace std ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair < int , int > pii ; 
typedef vector<int> vi;
#define fi first
#define se second
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()

const int MAXN = 1007 ;
const int MAXK = 57 ;

vector < ll > dp[ MAXN ][ MAXK ] ;
vector < ll > nw[ MAXK ] ;

int n , k ;
ll l , r ;
ll a[ MAXN ] ;
int cnt[ MAXN ] ;
vector < int > v[ MAXN ] ;
map < ll , ll > mn , mx ;

void opt ( vector < ll > &aux ) {
    mn.clear ( ) , mx.clear ( ) ;
    ll len = r - l + 1 ;
    for ( auto x : aux ) {
        if ( mn.find ( x / len ) == mn.end ( ) ) {
            mn[ x / len ] = x ;
        }
        if ( mn[ x / len ] > x ) { mn[ x / len ] = x ; }
        if ( mx[ x / len ] < x ) { mx[ x / len ] = x ; }
    }
    aux.clear ( ) ;
    for ( auto e : mn ) {
        aux.push_back ( e.se ) ;
        if ( e.se != mx[ e.fi ] ) {
            aux.push_back ( mx[ e.fi ] ) ;
        }
    }
}

void dfs ( int x , int prv ) {
    dp[ x ][ 0 ].push_back ( a[ x ] ) ;
    cnt[ x ] = 0 ;
    for ( auto y : v[ x ] ) {
        if ( y == prv ) { continue ; }
        dfs ( y , x ) ;
        for ( int i = 0 ; i <= k ; ++ i ) {
            nw[ i ].clear ( ) ;
        }
        for ( int i = 0 ; i <= cnt[ x ] ; ++ i ) {
            for ( int j = 0 ; j <= cnt[ y ] ; ++ j ) {
                if ( i + j > k ) { break ; }
                for ( auto val1 : dp[ x ][ i ] ) {
                    for ( auto val2 : dp[ y ][ j ] ) {
                        if ( val1 + val2 <= r ) { 
                            nw[ i + j ].push_back ( val1 + val2 ) ;
                        }
                    }
                }
            }
        }
        for ( int i = 0 ; i <= k ; ++ i ) {
            dp[ x ][ i ].clear ( ) ;
            opt ( nw[ i ] ) ;
            for ( auto val : nw[ i ] ) {
                dp[ x ][ i ].push_back ( val ) ;
            }
        }
        cnt[ x ] += cnt[ y ] ;
        if ( cnt[ x ] > k ) { cnt[ x ] = k ; }
    }
    ++ cnt[ x ] ;
    if ( cnt[ x ] > k ) { cnt[ x ] = k ; }
    if ( x == 1 ) { return ; }
    for ( int i = k ; i >= 0 ; -- i ) {
        for ( auto val : dp[ x ][ i ] ) {
            if ( l <= val && val <= r ) {
                dp[ x ][ i + 1 ].push_back ( 0 ) ;
                break ;
            }
        }
    }
}

void solve ( ) {
    cin >> n >> k >> l >> r ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
        v[ i ].clear ( ) ;
        for ( int j = 0 ; j <= k ; ++ j ) {
            dp[ i ][ j ].clear ( ) ;
        }
    }
    for ( int i = 1 , x , y ; i < n ; ++ i ) {
        cin >> x >> y ;
        v[ x ].push_back ( y ) ;
        v[ y ].push_back ( x ) ;
    }
    dfs ( 1 , -1 ) ;
    for ( int i = 0 ; i <= k ; ++ i ) {
        bool fl = false ;
        for ( auto x : dp[ 1 ][ i ] ) {
            if ( l <= x && x <= r ) {
                fl = true ;
                break ;
            }
        }
        if ( fl == true ) { cout << "1" ; }
        else { cout << "0" ; }
    }
    cout << "\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t = 1 ; cin >> t ; 
    while ( t -- ) { solve ( ) ; }
    return 0 ;
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 4880kb

input:

3
4 3 1 2
1 1 1 1
1 2
2 3
3 4
4 3 1 2
1 1 1 1
1 2
1 3
1 4
4 3 0 0
1 1 1 1
1 2
1 3
1 4

output:

0111
0011
0000

result:

ok 3 tokens

Test #2:

score: 0
Accepted
time: 4ms
memory: 4708kb

input:

100
10 9 18 50
18 0 9 8 11 11 13 16 9 2
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 38 50
4 10 11 13 19 6 14 14 20 14
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 26 50
6 1 12 7 1 12 20 2 0 12
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 29 50
16 13 1 17 20 15 0 3 6 7
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10...

output:

0011000000
0010000000
0100000000
0010000000
0011111000
0111100000
0010000000
0010000000
0100000000
0011111000
0110000000
0011000000
0011111100
0100000000
0010000000
0010000000
0010000000
0011000000
0111000000
0011100000
0100000000
0100000000
0100000000
0011000000
0011000000
0011111000
0011111110
001...

result:

ok 100 tokens

Test #3:

score: 0
Accepted
time: 4ms
memory: 4824kb

input:

100
10 9 23 50
13 10 9 11 14 13 11 9 14 14
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 11 50
11 9 9 9 14 7 9 12 14 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 27 50
14 13 9 13 9 13 9 14 14 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 41 50
8 10 10 13 8 6 12 7 10 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1...

output:

0011000000
0011110000
0010000000
0100000000
0011110000
0100000000
0011110000
0011110000
0011100000
0100000000
0011111100
0100000000
0011100000
0011100000
0100000000
0100000000
0011111000
0011000000
0100000000
0011000000
0011111100
0011100000
0100000000
0100000000
0100000000
0011111000
0011111111
010...

result:

ok 100 tokens

Test #4:

score: 0
Accepted
time: 2ms
memory: 4728kb

input:

100
10 9 17 50
9 8 10 12 12 10 12 10 9 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 19 50
10 9 8 10 12 12 8 11 12 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 46 50
8 8 10 10 10 8 9 10 11 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 9 50
9 8 11 10 11 10 10 11 11 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 ...

output:

0011100000
0011000000
0100000000
0011111110
0011111000
0011111111
0011111000
0100000000
0011110000
0011100000
0100000000
0011100000
0011100000
0100000000
0011110000
0011110000
0011100000
0100000000
0011100000
0011111111
0100000000
0011100000
0011000000
0100000000
0011111100
0011110000
0100000000
001...

result:

ok 100 tokens

Test #5:

score: 0
Accepted
time: 2ms
memory: 4880kb

input:

100
10 9 10 50
10 11 11 10 9 9 11 9 11 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 47 50
9 9 9 11 9 10 10 10 10 9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 49 50
9 10 9 11 11 9 11 10 10 9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 19 50
10 9 11 11 10 11 11 9 9 11
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10...

output:

0011111100
0100000000
0100000000
0011100000
0011110000
0011111111
0011110000
0100000000
0010000000
0100000000
0011111000
0011100000
0100000000
0011110000
0011110000
0011111000
0011111111
0011110000
0011111000
0011110000
0011111100
0011100000
0011000000
0011111111
0100000000
0011111111
0100000000
001...

result:

ok 100 tokens

Test #6:

score: 0
Accepted
time: 4ms
memory: 4768kb

input:

100
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
3 4
4 5
5 6
6...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #7:

score: 0
Accepted
time: 6ms
memory: 4864kb

input:

100
10 9 1793281831312430 2579712950976669
883262428445148 926941407766037 874610589009581 918671242302849 917202064660727 848094660280817 810513162735522 862049976415823 844577745576407 873085228984439
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 1890762965379103 2701769025604615
804306683243252 81402...

output:

0001000000
0001000000
0000100000
0000110000
0001111000
0000100000
0001111111
0000111100
0000111110
0000110000
0001111111
0000111000
0001100000
0001000000
0001100000
0001000000
0000111000
0001111100
0001000000
0001111110
0000110000
0000111100
0001000000
0001111111
0001100000
0001000000
0001000000
000...

result:

ok 100 tokens

Test #8:

score: 0
Accepted
time: 2ms
memory: 4784kb

input:

100
10 9 930392660078775 2806634959843587
930392660078775 905044994636391 985788965763349 912985101122684 987674992837788 921047708030944 933871032635272 924074917003015 906465081663363 976094961177209
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 1883664986961563 2834193280785472
958998107162380 924666...

output:

0000110000
0001000000
0000110000
0001110000
0001000000
0000111100
0001000000
0001000000
0001000000
0001000000
0001000000
0001100000
0001000000
0000111000
0001111000
0001000000
0001000000
0001111110
0001111110
0001000000
0001100000
0001110000
0001000000
0001110000
0000110000
0001110000
0001000000
000...

result:

ok 100 tokens

Test #9:

score: 0
Accepted
time: 1ms
memory: 4756kb

input:

100
10 9 999994984493978 2999942395429624
999994984493978 999939388770002 999967949978069 999931885129608 999990661850258 999984525481315 999963292059809 999975054238715 999981969673638 999985371517271
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 999995366940426 2999765738847089
999995366940426 9999556...

output:

0001100000
0000100000
0001000000
0000110000
0001111110
0000110000
0000111100
0001100000
0001111100
0000110000
0001100000
0000111110
0001100000
0001110000
0001111110
0000111000
0001110000
0001100000
0001100000
0000100000
0001110000
0001000000
0001000000
0001111110
0001111110
0000111110
0000100000
000...

result:

ok 100 tokens

Test #10:

score: 0
Accepted
time: 3ms
memory: 4856kb

input:

100
10 9 999999979118283 2999999819537067
999999979118283 999999975440440 999999958461371 999999979080922 999999991176682 999999985652594 999999984182267 999999928654853 999999990678448 999999900203766
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 999999951922360 2999999720940184
999999951922360 9999999...

output:

0000110000
0000111000
0001000000
0000100000
0001100000
0001100000
0001111000
0001110000
0001000000
0001000000
0000111000
0001110000
0001000000
0001111100
0001000000
0000110000
0000100000
0000110000
0001000000
0000110000
0001111111
0001111100
0001111100
0001000000
0001111100
0001110000
0000100000
000...

result:

ok 100 tokens

Test #11:

score: 0
Accepted
time: 3ms
memory: 4784kb

input:

100
10 9 999999999999480 2999999999998668
999999999999480 999999999999623 999999999999311 999999999999062 999999999999032 999999999999420 999999999999039 999999999999706 999999999999079 999999999999883
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 999999999999062 2999999999997761
999999999999062 9999999...

output:

0001110000
0000111110
0000111000
0000111100
0001110000
0000110000
0001100000
0001000000
0000111100
0000100000
0001111000
0001110000
0001111100
0001000000
0000111000
0000110000
0001000000
0001000000
0000110000
0000110000
0001110000
0001111110
0001000000
0001100000
0000111000
0001111100
0001000000
000...

result:

ok 100 tokens

Test #12:

score: 0
Accepted
time: 4ms
memory: 4856kb

input:

100
10 9 809217843509205176 1000000000000000000
819047520089857618 993247146028854493 979024090970900146 946916558454439857 809217843509205176 908857838415646655 809854521131167579 931917514552091282 890253286257158425 872828244740194237
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 810517126615250421 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #13:

score: 0
Accepted
time: 3ms
memory: 4812kb

input:

100
10 9 990469099227929497 1000000000000000000
997087653799379867 998602320157374700 997500855340614575 998172426490578932 998173419961973183 997315871904813866 990469099227929497 991331794758268536 996329227071528815 994942302495919962
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 990138767121283623 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #14:

score: 0
Accepted
time: 2ms
memory: 4796kb

input:

100
10 9 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 9 100000000...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #15:

score: 0
Accepted
time: 10ms
memory: 6796kb

input:

1
1000 50 3 50
0 0 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1...

output:

000000000011111111111111111111111111111111111111111

result:

ok "000000000011111111111111111111111111111111111111111"

Test #16:

score: 0
Accepted
time: 10ms
memory: 6048kb

input:

1
1000 50 16 50
0 2 1 2 0 0 0 1 0 2 1 0 2 2 1 2 2 2 1 0 0 1 1 0 2 1 2 1 2 1 0 0 1 1 0 2 2 2 2 0 0 2 2 2 1 1 0 1 1 1 1 1 0 2 1 1 2 2 2 0 0 2 0 0 1 1 0 0 2 1 2 1 1 1 2 0 0 2 2 2 1 1 1 0 1 0 1 1 2 2 0 0 2 0 1 2 2 0 0 0 2 2 1 2 1 0 2 1 1 0 1 0 0 1 1 0 0 1 0 0 2 2 2 0 0 1 2 2 1 1 2 2 0 2 2 0 1 0 1 0 1 1 ...

output:

000000000000000000001111111111111111111111111111111

result:

ok "000000000000000000001111111111111111111111111111111"

Test #17:

score: 0
Accepted
time: 6ms
memory: 6240kb

input:

1
1000 50 12 50
3 0 3 3 0 1 1 0 0 1 3 2 2 0 0 1 2 1 0 2 2 1 3 2 0 3 3 1 1 3 2 3 3 2 2 2 1 3 2 3 2 1 0 0 2 3 2 0 1 2 3 3 1 3 1 2 0 3 1 1 3 0 0 0 1 3 2 1 2 0 1 0 1 0 2 2 3 0 1 3 1 3 0 0 1 0 0 1 1 1 0 0 3 1 0 0 0 3 3 3 1 1 1 1 1 2 2 3 1 1 1 1 2 3 2 3 3 0 1 0 0 3 0 2 0 2 1 0 0 3 1 1 2 1 2 1 3 0 3 3 1 0 ...

output:

000000000000000000000000000000111111111111111111111

result:

ok "000000000000000000000000000000111111111111111111111"

Test #18:

score: 0
Accepted
time: 7ms
memory: 5484kb

input:

1
1000 50 42 50
1 1 2 0 2 2 2 3 1 4 1 2 2 2 3 4 3 2 3 0 2 1 4 4 2 1 1 3 3 4 3 2 1 1 0 3 2 1 4 3 4 0 0 3 3 2 1 0 1 0 0 4 1 3 3 1 4 0 0 1 4 1 3 2 4 2 4 4 3 4 0 1 0 1 1 1 0 4 3 3 1 2 4 3 4 3 1 2 1 4 3 0 3 4 1 4 4 0 0 2 1 1 4 3 3 2 4 4 1 1 3 3 1 1 4 3 2 3 0 2 4 4 4 1 0 3 2 1 0 3 4 4 3 4 0 2 2 0 1 1 4 2 ...

output:

000000000000000000000000000000000000000000111111000

result:

ok "000000000000000000000000000000000000000000111111000"

Test #19:

score: 0
Accepted
time: 7ms
memory: 5368kb

input:

1
1000 50 44 50
3 2 3 2 1 2 1 3 3 1 2 2 2 2 3 1 2 3 1 2 3 1 1 1 3 1 3 2 2 1 3 1 2 1 1 2 1 1 3 3 3 2 3 2 3 2 1 1 1 2 1 3 1 2 3 1 2 2 1 2 3 2 2 3 2 2 1 2 1 1 2 2 3 2 2 1 2 3 1 3 3 2 3 3 2 1 1 2 2 1 3 2 2 3 3 3 3 3 3 1 3 2 2 2 1 2 3 1 3 2 1 3 3 1 1 2 1 3 2 2 2 1 2 2 1 1 3 1 2 1 3 3 2 1 2 3 1 2 1 1 3 3 ...

output:

000000000000000000000000000000000000000011111000000

result:

ok "000000000000000000000000000000000000000011111000000"

Test #20:

score: 0
Accepted
time: 4ms
memory: 5032kb

input:

1
1000 50 50 50
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #21:

score: 0
Accepted
time: 10ms
memory: 5984kb

input:

1
1000 50 9067775517233793 27568152627261704
824143955544587 927579399534651 981801757217093 873773052413201 960257095164910 952261320093379 822434086320207 800147963710845 932219523834279 993157363400641 894323153846989 891533209662841 816940466685934 850744085351539 876674222750886 984981230477671...

output:

000000000000000000000000000000000111111111111111111

result:

ok "000000000000000000000000000000000111111111111111111"

Test #22:

score: 0
Accepted
time: 6ms
memory: 6020kb

input:

1
1000 50 10392950962364217 29677624285662191
952249828947457 989340248861758 922815904253124 988185672550932 901211610272775 916246836895084 911821518650392 969679688724958 917576531870585 962895648801013 960927472536139 985041956652122 955734234153218 924834554870256 927427626795671 99743959744383...

output:

000000000000000000000000000000001111111111111111111

result:

ok "000000000000000000000000000000001111111111111111111"

Test #23:

score: 0
Accepted
time: 4ms
memory: 5340kb

input:

1
1000 50 27998332064717309 30998401244356277
999923676529412 999964127454061 999901368076070 999965096214353 999973159921658 999940703209340 999901590913383 999994884859099 999948950882947 999900197152876 999903336019181 999974160658209 999963256360445 999962463135617 999900477973929 99993606716768...

output:

000000000000000000000000000000001110000000000000000

result:

ok "000000000000000000000000000000001110000000000000000"

Test #24:

score: 0
Accepted
time: 16ms
memory: 6272kb

input:

1
1000 50 4999999774482822 30999998337007262
999999966252791 999999947367745 999999905851118 999999999785542 999999955225626 999999997492014 999999907762313 999999913104525 999999962556159 999999998434960 999999943955799 999999938987651 999999919770925 999999918953335 999999940886692 999999936772000...

output:

000000000000000000000000000000000111111111111111111

result:

ok "000000000000000000000000000000000111111111111111111"

Test #25:

score: 0
Accepted
time: 8ms
memory: 5748kb

input:

1
1000 50 15999999999993257 30999999999985579
999999999999979 999999999999771 999999999999854 999999999999281 999999999999698 999999999999830 999999999999712 999999999999139 999999999999804 999999999999673 999999999999099 999999999999059 999999999999374 999999999999943 999999999999373 99999999999966...

output:

000000000000000000000000000000001111111111111111111

result:

ok "000000000000000000000000000000001111111111111111111"

Test #26:

score: 0
Accepted
time: 0ms
memory: 5088kb

input:

1
1000 50 800012418361959872 1000000000000000000
947369818918026096 942007600439311022 918881052204508717 898991866868830953 878449678306763381 921674051503661838 867715520616597795 880692389166218687 831246240027360885 977061124063742870 948796346350621716 937890416222692974 804321876310495686 8665...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #27:

score: 0
Accepted
time: 0ms
memory: 5144kb

input:

1
1000 50 990018432224876243 1000000000000000000
995440746039941717 991669382178948943 991935198890996390 993125966265179373 992741274852450701 991093927814885373 998609998029047476 999242003070483925 995948056384085956 995167742492048978 999099639351689010 992585906640490261 995767554302569406 9975...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #28:

score: 0
Accepted
time: 4ms
memory: 4964kb

input:

1
1000 50 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #29:

score: 0
Accepted
time: 3ms
memory: 4768kb

input:

100
10 9 15 50
7 14 18 19 7 3 13 5 6 8
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 36 50
13 3 3 7 7 11 9 19 0 10
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 20 50
6 3 3 19 12 9 17 13 20 20
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 20 50
0 11 16 13 7 18 7 13 15 2
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9...

output:

0011000000
0100000000
0001100000
0010000000
0010000000
0010000000
0010000000
0010000000
0011100000
0011100000
0010000000
0010000000
0111110000
0100000000
0100000000
0011000000
0010000000
0010000000
0100000000
0011100000
0100000000
0100000000
0011000000
0100000000
0011000000
0100000000
0100000000
010...

result:

ok 100 tokens

Test #30:

score: 0
Accepted
time: 3ms
memory: 4768kb

input:

100
10 9 23 50
15 12 5 6 8 14 12 14 8 15
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 19 50
10 6 6 9 8 5 8 7 14 14
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 40 50
12 6 8 8 6 10 10 7 10 13
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 17 50
12 7 12 11 9 13 7 8 14 8
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 ...

output:

0011000000
0010000000
0100000000
0011000000
0011000000
0011100000
0010000000
0010000000
0010000000
0011000000
0010000000
0011000000
0010000000
0011110000
0100000000
0011000000
0011000000
0010000000
0010000000
0010000000
0010000000
0011111000
0010000000
0010000000
0010000000
0011000000
0010000000
001...

result:

ok 100 tokens

Test #31:

score: 0
Accepted
time: 1ms
memory: 4716kb

input:

100
10 9 23 50
11 9 9 10 11 12 12 11 9 12
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 20 50
8 9 8 9 12 11 12 9 12 8
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 22 50
12 11 12 12 12 11 9 8 9 10
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 23 50
8 8 11 9 11 10 12 12 12 12
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10...

output:

0010000000
0010000000
0011000000
0010000000
0010000000
0011000000
0011000000
0011000000
0011000000
0010000000
0011000000
0011000000
0011000000
0010000000
0010000000
0010000000
0010000000
0010000000
0011000000
0011000000
0011000000
0011000000
0010000000
0010000000
0011000000
0011000000
0011000000
001...

result:

ok 100 tokens

Test #32:

score: 0
Accepted
time: 3ms
memory: 4800kb

input:

100
10 9 19 50
9 11 11 9 9 9 11 9 11 10
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 21 50
9 11 10 9 10 10 10 10 9 11
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 20 50
10 9 9 9 10 11 9 11 10 10
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 20 50
9 11 9 9 9 11 9 9 9 11
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 ...

output:

0011000000
0010000000
0010000000
0011000000
0010000000
0010000000
0011000000
0011000000
0011000000
0011000000
0011000000
0011000000
0010000000
0010000000
0011000000
0011000000
0011000000
0011000000
0011000000
0011000000
0011000000
0011000000
0010000000
0011000000
0011000000
0011000000
0011000000
001...

result:

ok 100 tokens

Test #33:

score: 0
Accepted
time: 3ms
memory: 4880kb

input:

100
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
2 4
2 5
3 6
3...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #34:

score: 0
Accepted
time: 1ms
memory: 4784kb

input:

100
10 9 903043839725508 2707074196186122
903043839725508 973202099194209 829984009795447 986683458077958 814248852378660 913353241639790 932268030485567 909500413864783 810890324243381 885601228094769
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 870280273045333 2782075394986519
870280273045333 9768762...

output:

0001111000
0001111100
0001000000
0001000000
0001111110
0001110000
0001100000
0001111100
0001000000
0001110000
0001110000
0001111110
0001111111
0001000000
0001110000
0001111000
0001111110
0001000000
0001111100
0001000000
0001100000
0001111110
0001000000
0001111100
0001111110
0001111111
0001000000
000...

result:

ok 100 tokens

Test #35:

score: 0
Accepted
time: 3ms
memory: 4856kb

input:

100
10 9 1866121251624223 2869996673058882
931154008118068 934967243506155 970998156812759 901096078239411 955203367470562 977334463478406 921664052767717 906995284181461 996247332277737 983302658795461
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 1935232744615275 2894968873722214
936884591729852 99834...

output:

0001000000
0001000000
0001000000
0001111110
0001000000
0001000000
0001110000
0001111000
0001111000
0001000000
0001111000
0001111110
0001000000
0001111111
0001000000
0001000000
0001100000
0001110000
0001000000
0001000000
0001000000
0001111110
0001110000
0001000000
0001100000
0001000000
0001000000
000...

result:

ok 100 tokens

Test #36:

score: 0
Accepted
time: 1ms
memory: 4752kb

input:

100
10 9 1999908914873019 2999856081168166
999960368017239 999986862183619 999983583230665 999912311844344 999964885222833 999928338194639 999944159742862 999947307305803 999919747391213 999944029650186
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 999956150993101 2999851224959263
999956150993101 999917...

output:

0001000000
0001110000
0001110000
0001000000
0001111100
0001111111
0001000000
0001000000
0001000000
0001110000
0001110000
0001111000
0001110000
0001000000
0001110000
0001111110
0001000000
0001111110
0001111000
0001111110
0001111111
0001000000
0001000000
0001111110
0001000000
0001111111
0001000000
000...

result:

ok 100 tokens

Test #37:

score: 0
Accepted
time: 3ms
memory: 4768kb

input:

100
10 9 999999932589125 2999999923145214
999999932589125 999999955609543 999999994910385 999999952296996 999999978882996 999999934455964 999999993778865 999999921122714 999999965213291 999999955253825
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 999999911464789 2999999920926873
999999911464789 9999999...

output:

0001111110
0001111100
0001110000
0001000000
0001000000
0001111100
0001000000
0001111000
0001000000
0001111000
0001110000
0001111000
0001000000
0001000000
0001000000
0001000000
0001000000
0001111100
0001000000
0001111111
0001000000
0001000000
0001000000
0001111111
0001100000
0001111100
0001000000
000...

result:

ok 100 tokens

Test #38:

score: 0
Accepted
time: 2ms
memory: 4776kb

input:

100
10 9 999999999999085 2999999999998858
999999999999085 999999999999590 999999999999912 999999999999229 999999999999232 999999999999506 999999999999440 999999999999208 999999999999464 999999999999692
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 999999999999284 2999999999998827
999999999999284 9999999...

output:

0001111111
0001111100
0001111000
0001000000
0001000000
0001111110
0001111100
0001000000
0001111100
0001111000
0001110000
0001111111
0001000000
0001000000
0001110000
0001100000
0001111111
0001111110
0001111111
0001111111
0001000000
0001111111
0001111000
0001110000
0001000000
0001111111
0001000000
000...

result:

ok 100 tokens

Test #39:

score: 0
Accepted
time: 3ms
memory: 4860kb

input:

100
10 9 881395859836029858 1000000000000000000
974093279292304002 949869240945029334 888242175265700181 909599751947474264 943499279072869120 881395859836029858 947124920770043581 956764868151177639 905534014770395870 956527416514760704
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 843028099553504974 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #40:

score: 0
Accepted
time: 3ms
memory: 4764kb

input:

100
10 9 991162912473331795 1000000000000000000
992164206414219639 992903059539442501 994668354511995636 993733851343822589 991162912473331795 997443699292478151 994647361327718197 991942440905700078 996863794272345801 993480892568797038
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 990182020218925256 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #41:

score: 0
Accepted
time: 3ms
memory: 4796kb

input:

100
10 9 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
10 9 100000000...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #42:

score: 0
Accepted
time: 4ms
memory: 4880kb

input:

1
1000 50 23 50
0 1 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 1 0 1 0 0 0 0 0 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 0 0 1 0 0 1 0 0 1 0 ...

output:

000000000000001100000000000000000000000000000000000

result:

ok "000000000000001100000000000000000000000000000000000"

Test #43:

score: 0
Accepted
time: 4ms
memory: 4880kb

input:

1
1000 50 23 50
1 2 0 0 0 0 2 1 0 0 1 0 1 2 0 2 0 0 1 1 2 2 0 2 2 2 2 1 0 0 0 1 2 2 1 1 2 1 2 1 2 0 0 0 0 1 1 0 2 0 1 1 0 2 2 2 0 1 1 2 0 1 0 0 1 1 2 1 0 2 0 0 2 0 1 0 2 2 0 0 0 1 0 2 1 2 0 1 0 0 2 1 0 1 2 0 2 0 1 2 2 1 0 0 0 1 2 1 1 0 1 1 2 2 1 0 0 0 1 1 0 2 2 1 2 2 2 1 1 2 2 2 0 1 1 0 0 2 0 0 1 1 ...

output:

000000000000000000000000000001110000000000000000000

result:

ok "000000000000000000000000000001110000000000000000000"

Test #44:

score: 0
Accepted
time: 4ms
memory: 4796kb

input:

1
1000 50 21 50
1 0 1 2 0 1 0 0 2 3 0 3 0 0 2 1 3 1 2 0 3 1 2 1 1 3 1 3 1 0 0 2 1 2 0 0 0 2 2 3 0 3 2 0 0 1 1 1 3 0 3 0 3 2 2 3 3 0 1 2 1 1 1 0 1 1 3 3 0 0 0 3 1 1 0 2 0 3 0 3 2 3 0 2 2 0 1 2 0 2 0 3 0 0 1 0 3 2 1 3 3 3 1 0 2 3 1 2 3 3 2 1 0 0 0 1 1 0 0 1 0 1 3 1 3 0 1 2 1 3 3 0 1 3 1 2 1 3 1 2 1 3 ...

output:

000000000000000000000000000000000000000111111111111

result:

ok "000000000000000000000000000000000000000111111111111"

Test #45:

score: 0
Accepted
time: 4ms
memory: 4872kb

input:

1
1000 50 16 50
2 4 4 4 0 1 3 3 4 2 1 1 3 0 4 4 4 1 3 4 1 3 3 3 0 1 2 0 2 3 3 1 0 3 4 2 4 0 2 1 0 0 1 4 4 3 3 0 4 4 1 4 3 4 4 4 2 2 3 4 1 1 1 3 1 4 0 3 2 2 0 2 4 4 1 2 2 2 1 3 1 1 2 4 0 4 1 0 4 4 0 2 4 1 3 2 1 3 0 1 4 0 0 3 4 3 0 1 2 3 2 0 1 1 0 1 3 1 1 2 4 1 4 1 2 1 3 4 4 4 1 4 3 0 4 3 2 2 1 0 4 1 ...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #46:

score: 0
Accepted
time: 4ms
memory: 4868kb

input:

1
1000 50 25 50
2 3 2 3 3 2 1 1 2 1 1 3 1 3 3 3 1 2 2 3 2 2 1 1 1 1 3 1 3 3 3 1 3 3 3 1 2 3 3 3 2 3 1 2 1 3 2 2 3 1 2 3 3 1 3 1 3 3 2 2 3 1 1 3 2 1 2 1 3 1 3 1 3 1 1 3 3 2 3 1 3 3 2 3 2 2 3 2 3 1 2 1 1 3 2 1 2 2 3 3 3 3 3 2 1 3 2 2 2 3 3 1 1 3 2 3 3 3 3 2 1 1 2 1 2 3 2 1 3 1 2 1 1 2 2 1 3 2 1 1 1 3 ...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #47:

score: 0
Accepted
time: 2ms
memory: 4936kb

input:

1
1000 50 50 50
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #48:

score: 0
Accepted
time: 4ms
memory: 4860kb

input:

1
1000 50 13403743128063067 28540184163713846
844358050287008 941099799527877 909650229455745 915414006020742 916956970131330 942749789591252 809881431452492 920530662917571 820491993057471 930698204102126 910235146807825 919353997191450 810996409096514 886426944686826 854848054473256 90913715981135...

output:

000000000000000000000000000000001111111111111111111

result:

ok "000000000000000000000000000000001111111111111111111"

Test #49:

score: 0
Accepted
time: 4ms
memory: 4972kb

input:

1
1000 50 14270970421357337 29813576683924935
913549551461200 960266885881039 987749521337291 926588087801681 911262239002731 941181568109118 954871333920399 943884237879546 954553788343837 920540095552393 913244878994959 974041126130862 921640453082650 967451357037073 991364490496274 98128686746918...

output:

000000000000000000000000000000001111111111111111100

result:

ok "000000000000000000000000000000001111111111111111100"

Test #50:

score: 0
Accepted
time: 4ms
memory: 4760kb

input:

1
1000 50 14999368371611065 30998776837144568
999908292506264 999973484971552 999907109946013 999975650897650 999908995355355 999934075173555 999908127571254 999913318830027 999917102065178 999961333661636 999994220566537 999942656063891 999929274808508 999906052907620 999933710921340 99996214713612...

output:

000000000000000000000000000000001111000000000000000

result:

ok "000000000000000000000000000000001111000000000000000"

Test #51:

score: 0
Accepted
time: 4ms
memory: 5004kb

input:

1
1000 50 14999999232270263 30999998736670207
999999914768635 999999992642321 999999950268641 999999911070140 999999929973409 999999967860221 999999993260621 999999953323137 999999945696169 999999907394602 999999947661401 999999928732750 999999994751429 999999966151288 999999902436828 99999994236144...

output:

000000000000000000000000000000001111111111111111111

result:

ok "000000000000000000000000000000001111111111111111111"

Test #52:

score: 0
Accepted
time: 1ms
memory: 4972kb

input:

1
1000 50 14999999999992098 30999999999987683
999999999999450 999999999999778 999999999999530 999999999999318 999999999999797 999999999999282 999999999999922 999999999999894 999999999999785 999999999999473 999999999999754 999999999999217 999999999999723 999999999999319 999999999999817 99999999999962...

output:

000000000000000000000000000000001111111111111111111

result:

ok "000000000000000000000000000000001111111111111111111"

Test #53:

score: 0
Accepted
time: 0ms
memory: 4872kb

input:

1
1000 50 800182427907563622 1000000000000000000
877707230999575106 883095548959435323 869008597368688797 869353933666007949 893276779330373078 864815901460109337 995958945802864957 800338504864838776 860140608204872636 890857119062727523 864030576490197732 897826159758389329 892115893749653254 8780...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #54:

score: 0
Accepted
time: 4ms
memory: 4872kb

input:

1
1000 50 990000239027219651 1000000000000000000
995271413250718145 991135682668957584 990991730347466435 997830698035722256 994532647366512215 993771477912877319 994416974997065433 997581046106825658 999554888411050032 999320173865935086 999599139963677981 991922054570914155 994050840709655053 9937...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #55:

score: 0
Accepted
time: 2ms
memory: 4944kb

input:

1
1000 50 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #56:

score: 0
Accepted
time: 3ms
memory: 4772kb

input:

100
10 9 7 50
7 16 16 15 13 14 4 18 6 13
1 2
2 3
2 4
2 5
5 6
2 7
5 8
8 9
7 10
10 9 17 50
0 8 2 17 4 14 18 18 17 8
1 2
1 3
3 4
2 5
4 6
5 7
2 8
2 9
5 10
10 9 12 50
9 5 20 1 9 18 16 18 2 11
1 2
2 3
1 4
2 5
1 6
3 7
5 8
5 9
4 10
10 9 15 50
0 4 18 9 0 20 13 14 16 15
1 2
2 3
2 4
2 5
1 6
3 7
6 8
5 9
1 10
10...

output:

0000111100
0011100000
0011110000
0011000000
0011111110
0100000000
0001100000
0011000000
0011000000
0011000000
0001100000
0100000000
0100000000
0010000000
0011111000
0100000000
0011111110
0011100000
0011110000
0100000000
0010000000
0011000000
0100000000
0011111100
0100000000
0010000000
0010000000
000...

result:

ok 100 tokens

Test #57:

score: 0
Accepted
time: 1ms
memory: 4704kb

input:

100
10 9 23 50
15 8 7 7 14 9 12 9 9 14
1 2
1 3
3 4
4 5
4 6
6 7
4 8
4 9
7 10
10 9 36 50
10 15 15 10 15 6 15 5 14 10
1 2
2 3
2 4
4 5
4 6
1 7
4 8
3 9
9 10
10 9 10 50
11 9 8 7 10 7 9 10 10 13
1 2
2 3
2 4
1 5
4 6
4 7
3 8
3 9
7 10
10 9 19 50
9 5 15 14 14 10 5 10 12 14
1 2
2 3
1 4
1 5
2 6
5 7
4 8
2 9
9 10
...

output:

0010000000
0010000000
0011111000
0001000000
0010000000
0011100000
0011111100
0110000000
0011111111
0111000000
0001111111
0011100000
0010000000
0011100000
0011110000
0001000000
0010000000
0011111111
0011000000
0011000000
0001111000
0100000000
0011100000
0100000000
0010000000
0100000000
0100000000
000...

result:

ok 100 tokens

Test #58:

score: 0
Accepted
time: 1ms
memory: 4888kb

input:

100
10 9 18 50
11 9 8 8 8 9 10 11 10 8
1 2
2 3
1 4
2 5
5 6
4 7
1 8
8 9
8 10
10 9 8 50
8 8 11 12 12 8 8 9 11 9
1 2
1 3
1 4
1 5
1 6
2 7
2 8
8 9
5 10
10 9 11 50
11 11 9 11 11 11 8 12 11 8
1 2
1 3
2 4
4 5
3 6
5 7
7 8
1 9
6 10
10 9 11 50
11 8 10 10 12 10 11 11 9 8
1 2
2 3
1 4
4 5
3 6
1 7
4 8
6 9
3 10
10 ...

output:

0010000000
0011111111
0011111000
0011110000
0011111110
0011111110
0011111000
0010000000
0011100000
0011110000
0011000000
0011100000
0011000000
0011110000
0011111000
0011111110
0011111000
0010000000
0011110000
0011111100
0001100000
0010000000
0011000000
0011111000
0011000000
0011111000
0011111110
010...

result:

ok 100 tokens

Test #59:

score: 0
Accepted
time: 3ms
memory: 4784kb

input:

100
10 9 49 50
10 11 10 10 10 10 9 9 9 11
1 2
2 3
2 4
3 5
1 6
5 7
7 8
1 9
3 10
10 9 21 50
10 9 11 10 9 9 10 10 11 9
1 2
1 3
2 4
3 5
3 6
3 7
6 8
7 9
5 10
10 9 10 50
9 10 9 11 10 11 9 10 10 10
1 2
2 3
3 4
4 5
3 6
3 7
6 8
3 9
7 10
10 9 20 50
10 11 10 10 11 11 11 11 11 10
1 2
2 3
1 4
4 5
5 6
5 7
2 8
8 9...

output:

0100000000
0010000000
0001111100
0011100000
0011111111
0001111000
0011111111
0011000000
0100000000
0010000000
0011110000
0100000000
0010000000
0100000000
0011111111
0001000000
0011111100
0011110000
0100000000
0010000000
0001111000
0010000000
0010000000
0011000000
0011111000
0100000000
0011000000
001...

result:

ok 100 tokens

Test #60:

score: 0
Accepted
time: 3ms
memory: 4728kb

input:

100
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
1 4
1 5
5 6
1 7
3 8
3 9
9 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
2 4
2 5
4 6
1 7
2 8
2 9
9 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
2 4
2 5
1 6
6 7
5 8
2 9
6 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
2 3
3 4
3 5
5 6
5...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #61:

score: 0
Accepted
time: 1ms
memory: 4732kb

input:

100
10 9 801108066478719 1689977019598213
893931095149176 954133934516755 803734575928958 829619784019150 903187273919964 890190632461710 849912465248459 836318330139793 840064554349754 801108066478719
1 2
1 3
3 4
3 5
1 6
5 7
3 8
7 9
5 10
10 9 847671746189690 2585681475127423
812829279630537 8884196...

output:

0000000111
0001111000
0000111100
0000001000
0000011000
0000011000
0000010000
0001111100
0000110000
0001000000
0000100000
0000011000
0000001100
0000100000
0000011100
0000001111
0000100000
0001000000
0000011000
0000000001
0000001100
0001111111
0000011100
0001000000
0001111111
0000001110
0000010000
000...

result:

ok 100 tokens

Test #62:

score: 0
Accepted
time: 4ms
memory: 4856kb

input:

100
10 9 963673675539838 1918221779953110
963673675539838 920733958239216 925210763198845 968413551503443 949314598136778 968907181816332 962379422150733 902501445939560 901218206686808 995291632294591
1 2
2 3
3 4
4 5
5 6
4 7
4 8
7 9
2 10
10 9 1904580472534452 2852417025839791
915017306010227 929012...

output:

0000010000
0001000000
0001111110
0000010000
0001111000
0000000100
0001000000
0000011111
0000011111
0000011000
0001111000
0001000000
0001110000
0000001100
0001000000
0001000000
0001111110
0000001000
0001111110
0000010000
0001111100
0001110000
0001110000
0000111110
0000000111
0001000000
0000010000
000...

result:

ok 100 tokens

Test #63:

score: 0
Accepted
time: 1ms
memory: 4704kb

input:

100
10 9 999920228655432 1999866563283371
999919327342090 999914117901743 999975520696320 999975075269317 999905680734994 999916874513207 999912657452985 999920228655432 999980421323332 999949688770164
1 2
1 3
2 4
3 5
2 6
5 7
3 8
1 9
6 10
10 9 999987377485979 2999831744089624
999987377485979 9999433...

output:

0000001000
0000100000
0000010000
0001111111
0000111110
0000001111
0000010000
0001110000
0000100000
0000000110
0000111111
0001111000
0001000000
0001100000
0000100000
0000100000
0001111000
0000011110
0000001000
0001111100
0001000000
0000001110
0000100000
0000111000
0001110000
0001111100
0001110000
000...

result:

ok 100 tokens

Test #64:

score: 0
Accepted
time: 3ms
memory: 4788kb

input:

100
10 9 999999905859179 1999999892942771
999999933175919 999999943059586 999999974134933 999999959992746 999999947949768 999999977501819 999999905859179 999999920311260 999999918697857 999999915440952
1 2
2 3
1 4
3 5
5 6
1 7
4 8
5 9
6 10
10 9 999999974107503 1999999925863993
999999974107503 9999999...

output:

0000011111
0000010000
0001000000
0001000000
0001000000
0000001100
0000011110
0000111100
0001110000
0000100000
0000111100
0001111111
0000111111
0001000000
0000111110
0000001000
0001100000
0001100000
0000111000
0001000000
0000110000
0000010000
0000011000
0001111110
0000010000
0000111111
0000000110
000...

result:

ok 100 tokens

Test #65:

score: 0
Accepted
time: 0ms
memory: 4704kb

input:

100
10 9 999999999999459 2999999999998486
999999999999970 999999999999349 999999999999297 999999999999522 999999999999017 999999999999459 999999999999459 999999999999052 999999999999615 999999999999862
1 2
1 3
2 4
3 5
1 6
1 7
5 8
2 9
1 10
10 9 999999999999270 2999999999998521
999999999999371 9999999...

output:

0000111000
0000111111
0000100000
0000000010
0001110000
0000000001
0000111100
0000000111
0000111100
0000011100
0001110000
0001000000
0001111111
0000001100
0000011000
0000011100
0000011100
0001111100
0001100000
0001110000
0001000000
0000011100
0001000000
0000011000
0000111000
0001000000
0000110000
000...

result:

ok 100 tokens

Test #66:

score: 0
Accepted
time: 2ms
memory: 4732kb

input:

100
10 9 822429062566280904 1000000000000000000
998754645157249317 909011270176226893 960833040408528501 901317631965602717 872468070975832624 910064785133270102 958664832830016589 951476356252549015 934807242211916314 822429062566280904
1 2
2 3
2 4
2 5
5 6
1 7
5 8
1 9
7 10
10 9 847068538606368988 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #67:

score: 0
Accepted
time: 3ms
memory: 4828kb

input:

100
10 9 990452152800636005 1000000000000000000
996861263585555309 999314563177294191 992156502561484883 992763314252643817 993469406526726686 990452152800636005 990961749515092884 991861995064174787 998589126022561265 992431649951925180
1 2
1 3
3 4
4 5
5 6
6 7
2 8
2 9
9 10
10 9 990150626920745804 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #68:

score: 0
Accepted
time: 4ms
memory: 4732kb

input:

100
10 9 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
1 2
1 3
3 4
3 5
4 6
2 7
6 8
1 9
6 10
10 9 100000000...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #69:

score: 0
Accepted
time: 2ms
memory: 5052kb

input:

1
1000 50 2 50
1 1 1 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 0 0 0...

output:

000000000000000111111111111111111111111111111111111

result:

ok "000000000000000111111111111111111111111111111111111"

Test #70:

score: 0
Accepted
time: 4ms
memory: 5036kb

input:

1
1000 50 1 50
1 1 1 0 2 0 2 1 1 2 2 1 0 0 2 1 2 0 1 1 0 0 1 2 0 0 1 0 0 1 0 2 1 0 1 2 0 1 1 2 2 0 1 1 1 0 2 1 1 1 2 1 1 0 2 2 0 2 1 2 1 0 1 1 0 2 0 2 0 0 1 2 2 2 1 0 2 0 2 2 1 2 1 2 2 2 2 0 1 1 0 1 2 0 0 2 1 2 0 2 2 1 0 0 0 2 0 1 1 1 1 1 1 0 1 0 2 0 1 0 1 0 2 1 0 2 2 1 0 1 0 0 0 0 2 2 0 1 0 0 2 2 1...

output:

000000000000000000000000000000111111111111111111111

result:

ok "000000000000000000000000000000111111111111111111111"

Test #71:

score: 0
Accepted
time: 7ms
memory: 5032kb

input:

1
1000 50 1 50
3 1 3 1 3 2 2 0 0 1 1 0 2 1 3 3 1 1 1 2 2 3 3 2 0 1 2 0 0 3 0 2 1 2 3 0 1 0 2 1 2 2 2 3 2 1 2 2 0 1 0 1 1 0 2 3 0 0 2 3 1 1 2 1 2 0 1 3 1 3 0 1 3 3 2 2 1 1 0 1 2 1 2 0 2 2 0 0 2 3 1 3 1 3 0 0 0 3 1 3 3 3 1 3 3 0 0 2 2 1 0 0 1 1 1 0 1 3 0 1 2 3 2 3 3 2 3 0 1 1 0 3 0 2 0 0 0 2 0 2 1 1 3...

output:

000000000000000000000000000000000000000000001111111

result:

ok "000000000000000000000000000000000000000000001111111"

Test #72:

score: 0
Accepted
time: 5ms
memory: 5004kb

input:

1
1000 50 1 50
3 1 1 2 2 4 2 2 1 0 3 0 1 1 2 0 4 0 3 0 0 1 0 0 3 0 0 2 0 0 1 4 1 4 2 3 3 4 4 1 0 0 2 0 4 2 4 1 3 1 0 1 4 0 3 3 2 0 3 0 2 1 0 1 2 3 4 3 1 2 0 0 1 1 4 0 0 3 4 0 2 4 0 1 4 3 1 0 4 0 3 0 0 2 1 1 1 4 1 0 4 4 4 4 3 4 4 4 4 2 1 0 2 4 3 3 3 4 3 1 1 4 1 1 4 1 3 2 1 0 2 4 0 4 2 2 0 0 1 2 1 1 3...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #73:

score: 0
Accepted
time: 8ms
memory: 4996kb

input:

1
1000 50 2 50
2 3 2 3 2 1 1 3 2 1 3 3 1 1 3 3 1 2 2 1 1 3 3 3 3 1 3 1 1 2 1 2 2 1 3 2 1 1 3 2 1 2 3 2 3 3 3 1 3 1 2 2 1 2 1 1 3 3 2 2 3 2 1 2 2 2 2 1 2 2 2 3 2 3 1 1 1 2 2 2 3 1 3 3 3 2 1 1 2 2 3 1 1 1 3 3 2 3 1 2 3 3 3 2 1 1 2 1 2 1 3 1 2 3 2 3 3 2 3 1 3 3 3 2 3 1 3 1 3 2 1 3 3 1 3 1 2 1 2 1 3 2 2...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #74:

score: 0
Accepted
time: 4ms
memory: 4916kb

input:

1
1000 50 50 50
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #75:

score: 0
Accepted
time: 4ms
memory: 5044kb

input:

1
1000 50 825184394965286 27072111663660075
820737266532750 923191704889836 920392699363191 802948293712361 867666819933634 967393608416683 844443682443845 856361188238131 996564149943615 817125489794223 802220083507421 976399190562453 957806495712928 819170026910369 818882276484629 994033049006164 ...

output:

000000000000000000000000000000000000000000000111111

result:

ok "000000000000000000000000000000000000000000000111111"

Test #76:

score: 0
Accepted
time: 6ms
memory: 5132kb

input:

1
1000 50 948333175425578 29383050061801456
968960480009412 952085366610587 983760604510175 966777719630893 900906321788913 943902464343185 907340370342109 965897934474824 945324814938955 966875865367202 992354431161956 953690710413549 941063689186637 995475585994143 913109147271874 952642561854885 ...

output:

000000000000000000000000000000000000000000000000111

result:

ok "000000000000000000000000000000000000000000000000111"

Test #77:

score: 0
Accepted
time: 11ms
memory: 5168kb

input:

1
1000 50 999916262863909 30998644021651884
999964374665514 999903592915931 999924937206659 999928019356357 999900602560359 999913189406590 999965556328499 999966274490064 999908627457409 999928631376264 999915256890635 999951026366682 999918167981679 999963944311547 999980006458202 999902324493782 ...

output:

000000000000000000000000000000000000000000000111111

result:

ok "000000000000000000000000000000000000000000000111111"

Test #78:

score: 0
Accepted
time: 5ms
memory: 5108kb

input:

1
1000 50 999999901764062 27999998804517070
999999949562388 999999980808710 999999961831885 999999966927653 999999993874451 999999960965897 999999991757146 999999929833801 999999941044832 999999905227736 999999943766922 999999976951250 999999982320998 999999922362658 999999923183410 999999925646884 ...

output:

000000000000000000000000000000000000000000000000111

result:

ok "000000000000000000000000000000000000000000000000111"

Test #79:

score: 0
Accepted
time: 6ms
memory: 5092kb

input:

1
1000 50 999999999999005 30999999999983478
999999999999580 999999999999160 999999999999396 999999999999263 999999999999730 999999999999297 999999999999317 999999999999272 999999999999716 999999999999292 999999999999750 999999999999407 999999999999656 999999999999219 999999999999419 999999999999793 ...

output:

000000000000000000000000000000000000000000001111111

result:

ok "000000000000000000000000000000000000000000001111111"

Test #80:

score: 0
Accepted
time: 4ms
memory: 4892kb

input:

1
1000 50 800175322999623349 1000000000000000000
861665043427282601 930570419740033490 901740455500400690 897167247568945604 981072837978804914 995283358890552218 950522582023982102 881331738015609359 822318556341863693 843969530733824064 839302228378714650 899227513081095828 962211944991914763 8619...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #81:

score: 0
Accepted
time: 2ms
memory: 4944kb

input:

1
1000 50 990014431941695853 1000000000000000000
990699721010369582 991554919101506969 993667514267164322 997626898728850169 996374266191294515 997208303221737749 994706199235818020 999336336444469809 990811171892430119 997075782405824540 996829791137208788 990546212223239142 997851826538967525 9908...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #82:

score: 0
Accepted
time: 0ms
memory: 4848kb

input:

1
1000 50 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #83:

score: 0
Accepted
time: 4ms
memory: 4888kb

input:

100
10 9 17 50
7 7 16 0 3 18 19 17 2 11
2 6
5 3
7 5
7 8
9 7
10 9
2 10
2 1
2 4
10 9 21 50
7 2 8 2 0 9 8 3 9 14
5 8
5 6
2 1
10 9
2 5
4 2
10 7
3 10
3 4
10 9 39 50
10 18 6 2 0 15 14 0 9 12
2 9
1 6
4 1
10 4
8 7
3 8
2 3
10 2
10 5
10 9 5 50
8 11 17 4 10 6 5 16 2 1
1 5
4 9
1 2
4 1
3 6
3 10
3 8
4 3
4 7
10 9 ...

output:

0011100000
0100000000
0100000000
0111111100
0011000000
0011100000
0010000000
0010000000
0011111111
0100000000
0100000000
0010000000
0100000000
0010000000
0010000000
0010000000
0010000000
0100000000
0001000000
0001111000
0001000000
0100000000
0001110000
0010000000
0010000000
0111100000
0100000000
010...

result:

ok 100 tokens

Test #84:

score: 0
Accepted
time: 4ms
memory: 4820kb

input:

100
10 9 48 50
12 10 7 14 12 7 5 11 14 6
4 10
3 9
1 7
3 1
3 2
6 3
8 6
4 8
4 5
10 9 22 50
12 6 6 13 11 14 6 5 7 11
4 6
9 10
1 9
4 7
4 3
1 4
8 1
5 8
2 5
10 9 24 50
8 11 5 15 13 11 12 8 6 12
6 9
4 6
10 5
10 1
7 10
4 7
8 4
2 8
2 3
10 9 42 50
10 9 7 6 9 5 14 11 6 13
1 4
5 8
5 10
1 7
9 6
2 5
1 2
3 1
3 9
1...

output:

0100000000
0010000000
0010000000
0100000000
0010000000
0010000000
0010000000
0011111000
0011000000
0010000000
0010000000
0001100000
0011000000
0100000000
0001000000
0010000000
0011111000
0100000000
0011100000
0100000000
0100000000
0100000000
0010000000
0011110000
0010000000
0011111000
0010000000
001...

result:

ok 100 tokens

Test #85:

score: 0
Accepted
time: 4ms
memory: 4708kb

input:

100
10 9 22 50
12 10 10 10 9 8 12 12 8 9
8 2
10 5
1 10
3 1
7 3
8 7
4 9
8 4
6 8
10 9 27 50
10 12 12 11 8 10 9 10 12 8
9 8
5 1
6 2
5 7
6 3
9 6
9 5
10 9
10 4
10 9 30 50
9 10 11 9 8 9 8 12 10 11
3 4
10 2
5 7
8 9
6 8
10 6
1 10
5 1
5 3
10 9 18 50
8 11 12 12 12 10 8 9 11 12
1 6
7 1
2 3
4 7
2 4
8 10
5 2
8 5...

output:

0010000000
0010000000
0010000000
0011000000
0100000000
0011110000
0011111100
0010000000
0010000000
0011110000
0010000000
0010000000
0011100000
0100000000
0010000000
0011100000
0100000000
0011111100
0010000000
0010000000
0010000000
0011111111
0011100000
0100000000
0010000000
0011000000
0100000000
001...

result:

ok 100 tokens

Test #86:

score: 0
Accepted
time: 3ms
memory: 4708kb

input:

100
10 9 22 50
11 11 9 11 9 11 11 11 9 9
1 6
4 1
8 2
5 10
4 3
5 8
9 5
4 7
4 9
10 9 10 50
10 9 11 11 10 10 10 10 11 10
9 8
4 3
6 9
6 7
6 1
10 5
6 4
2 6
2 10
10 9 29 50
10 11 10 9 9 11 9 10 11 10
5 4
2 9
5 8
10 7
3 2
6 5
3 6
10 3
10 1
10 9 19 50
9 10 11 9 9 11 9 10 10 11
3 2
7 5
10 7
8 6
1 9
8 1
10 8
...

output:

0011000000
0001111110
0010000000
0011000000
0011000000
0011111111
0001100000
0011110000
0100000000
0011110000
0011000000
0010000000
0010000000
0100000000
0010000000
0010000000
0100000000
0011111111
0100000000
0011111111
0011100000
0010000000
0011111111
0011000000
0100000000
0011111111
0011110000
001...

result:

ok 100 tokens

Test #87:

score: 0
Accepted
time: 4ms
memory: 4736kb

input:

100
10 9 50 50
50 50 50 50 50 50 50 50 50 50
8 9
10 7
1 8
6 1
4 6
2 3
2 5
4 10
4 2
10 9 50 50
50 50 50 50 50 50 50 50 50 50
3 8
4 6
5 1
3 4
7 3
10 7
5 10
9 5
9 2
10 9 50 50
50 50 50 50 50 50 50 50 50 50
9 3
6 1
6 2
8 6
4 8
10 4
10 7
5 10
5 9
10 9 50 50
50 50 50 50 50 50 50 50 50 50
10 8
2 1
9 2
6 3
...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #88:

score: 0
Accepted
time: 4ms
memory: 4768kb

input:

100
10 9 1623500691675307 1904842502878379
981974957097725 909711946607348 881179946369522 819679849043758 907241612477030 970797093460695 803820842631549 814009366321726 970017216508640 934045409417684
6 10
1 2
5 6
5 8
4 7
5 4
1 5
9 1
3 9
10 9 879071867648969 1945055488289662
824570113153171 956088...

output:

0000100000
0000011100
0000111000
0001111110
0001000000
0000010000
0000110000
0001100000
0000001111
0001100000
0001110000
0000110000
0001100000
0000011110
0001111100
0000100000
0000011110
0001000000
0000000110
0001110000
0000000110
0001000000
0001000000
0001000000
0001000000
0000111111
0001000000
000...

result:

ok 100 tokens

Test #89:

score: 0
Accepted
time: 0ms
memory: 4772kb

input:

100
10 9 962995074488942 1942276286219413
962995074488942 946224087673800 981292799306974 954285101547762 957701446421123 950195504599051 920336826879731 978490961369784 960983486912439 962373122810878
4 10
7 2
4 8
5 6
4 1
4 7
4 5
9 4
9 3
10 9 918326295688606 2884968579073122
918326295688606 9121725...

output:

0000010000
0001111110
0001100000
0000100000
0000100000
0000100000
0000001000
0001000000
0001110000
0001111100
0000011000
0000100000
0000011000
0001000000
0000011100
0001000000
0001100000
0000001000
0000111000
0001110000
0000100000
0001000000
0001000000
0000110000
0001000000
0000000100
0000100000
000...

result:

ok 100 tokens

Test #90:

score: 0
Accepted
time: 4ms
memory: 4772kb

input:

100
10 9 999953796588092 2999906789200704
999958376812591 999993329536858 999972392548586 999995587374554 999900721637144 999979432290598 999954964361520 999989624440740 999966985422115 999953796588092
6 3
8 1
9 4
6 7
8 6
8 2
10 8
9 10
5 9
10 9 999932198870332 1999893057884727
999974996386756 999976...

output:

0001111110
0000000010
0000110000
0000001110
0001100000
0000111100
0001000000
0000111111
0000000010
0000100000
0000111110
0000011110
0000100000
0001111110
0001000000
0001000000
0001000000
0000100000
0000011111
0001000000
0000100000
0001110000
0000010000
0001111110
0000010000
0001000000
0001111110
000...

result:

ok 100 tokens

Test #91:

score: 0
Accepted
time: 4ms
memory: 4768kb

input:

100
10 9 999999908565525 2999999890587726
999999908565525 999999948978591 999999916203978 999999986852953 999999901293491 999999957681544 999999917332276 999999956831618 999999987012004 999999976074564
2 1
8 10
4 9
5 4
2 5
7 2
3 7
8 3
8 6
10 9 999999996568362 2999999801596948
999999996568362 9999999...

output:

0001111110
0000100000
0001000000
0000000110
0000011100
0000010000
0001000000
0001100000
0000100000
0001111111
0001100000
0001111000
0000111111
0001000000
0001000000
0000111000
0001000000
0000100000
0001111100
0000111110
0001111000
0000111000
0001000000
0000100000
0001111110
0001000000
0000000100
000...

result:

ok 100 tokens

Test #92:

score: 0
Accepted
time: 3ms
memory: 4732kb

input:

100
10 9 999999999999274 1999999999998896
999999999999779 999999999999664 999999999999153 999999999999073 999999999999743 999999999999563 999999999999709 999999999999982 999999999999010 999999999999274
5 3
10 2
6 9
10 6
10 1
8 10
7 4
7 8
7 5
10 9 999999999999424 2999999999998607
999999999999424 9999...

output:

0000001000
0000111100
0000000100
0000001000
0001000000
0000011100
0001000000
0000111110
0001000000
0000011000
0000111100
0000010000
0000111000
0001111110
0000111111
0001000000
0000111000
0000110000
0001110000
0001111100
0000111110
0001111110
0001000000
0001111110
0001000000
0000000110
0001000000
000...

result:

ok 100 tokens

Test #93:

score: 0
Accepted
time: 3ms
memory: 4768kb

input:

100
10 9 801480378501055646 1000000000000000000
801480378501055646 922660819655977925 858262454728756981 803250601630185479 848103528161275949 877245087234844530 902170019241631180 825707676438499105 921541910991013614 857984773366265499
4 3
1 5
7 6
9 7
4 9
2 4
8 2
1 8
1 10
10 9 801167637165652077 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #94:

score: 0
Accepted
time: 3ms
memory: 4824kb

input:

100
10 9 991957565900323888 1000000000000000000
999755093676486247 995390847032877284 992076168396856273 995614761117010160 994035682314572021 996477538595333214 994096504979025980 991957565900323888 993337190751807200 999819368713923773
8 9
8 3
7 10
2 7
6 2
1 8
5 1
6 5
6 4
10 9 990925912792544103 1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #95:

score: 0
Accepted
time: 3ms
memory: 4732kb

input:

100
10 9 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
10 1
8 9
4 8
5 4
10 5
6 3
10 6
2 10
2 7
10 9 100000...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #96:

score: 0
Accepted
time: 4ms
memory: 4896kb

input:

1
1000 50 19 50
1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 ...

output:

000000000000111111111100000000000000000000000000000

result:

ok "000000000000111111111100000000000000000000000000000"

Test #97:

score: 0
Accepted
time: 3ms
memory: 5176kb

input:

1
1000 50 2 50
0 0 1 0 2 0 0 0 1 1 0 1 0 0 1 2 0 2 0 0 1 2 0 1 2 0 2 1 1 1 0 2 2 1 1 0 0 2 2 2 0 1 0 2 0 0 0 2 0 1 1 2 2 0 2 1 2 0 2 0 0 0 2 0 2 1 0 0 0 1 0 2 0 1 2 1 0 2 0 0 1 1 2 0 1 0 0 1 1 2 2 0 1 2 1 2 0 2 0 0 2 2 1 1 1 0 0 1 2 1 1 0 1 0 1 2 0 1 2 1 0 1 2 2 1 0 1 2 0 2 2 2 0 2 1 1 2 2 2 0 2 2 2...

output:

000000000000000000000000111111111111111111111111111

result:

ok "000000000000000000000000111111111111111111111111111"

Test #98:

score: 0
Accepted
time: 0ms
memory: 4980kb

input:

1
1000 50 9 50
0 2 0 0 3 2 0 2 2 0 2 1 0 3 2 3 0 3 1 3 1 1 0 1 3 1 1 1 0 3 0 0 0 3 3 1 1 1 3 1 0 2 1 3 2 1 2 2 0 2 3 2 3 2 1 3 1 1 2 2 2 2 2 1 0 3 3 3 0 3 2 2 2 2 0 0 0 1 2 2 0 3 1 0 2 1 2 3 3 2 3 1 1 0 1 1 0 1 0 0 2 3 2 1 0 1 3 2 3 3 2 1 0 2 3 0 1 2 0 1 1 2 1 3 0 0 3 3 0 2 0 3 1 1 1 3 2 2 3 3 2 0 3...

output:

000000000000000000000000000000000011111111111111111

result:

ok "000000000000000000000000000000000011111111111111111"

Test #99:

score: 0
Accepted
time: 6ms
memory: 5156kb

input:

1
1000 50 4 50
4 3 1 2 4 4 0 2 0 2 4 2 0 3 3 1 2 1 4 1 3 2 3 0 2 0 1 1 4 2 4 1 3 4 2 1 1 0 2 2 3 3 2 4 4 2 1 2 4 2 3 4 0 4 1 1 3 2 3 0 1 1 0 2 4 4 4 0 3 0 1 1 3 1 3 4 0 0 3 2 1 1 3 1 3 3 4 4 0 2 1 3 0 1 2 0 2 2 4 1 2 0 1 3 1 2 0 3 3 2 1 2 1 1 4 4 4 2 2 0 1 4 4 4 2 3 3 4 2 2 3 0 1 0 1 1 2 1 1 2 2 1 0...

output:

000000000000000000000000000000000000000000011111111

result:

ok "000000000000000000000000000000000000000000011111111"

Test #100:

score: 0
Accepted
time: 2ms
memory: 5116kb

input:

1
1000 50 8 50
2 1 1 3 1 1 1 3 3 2 1 2 1 1 1 2 3 1 2 3 3 2 1 2 3 2 3 2 3 3 1 2 3 3 3 2 1 3 1 2 2 2 1 3 1 2 2 1 2 1 3 2 1 2 2 3 1 3 1 1 1 1 2 3 3 3 2 3 1 3 1 1 1 2 1 3 2 1 3 1 3 3 2 3 1 2 2 2 3 1 3 3 3 1 3 3 3 2 3 1 2 2 3 2 2 1 3 3 3 2 2 2 3 1 2 2 1 1 3 1 1 2 3 2 2 2 3 3 1 2 2 1 2 1 3 2 2 1 3 1 3 1 2...

output:

000000000000000000000000000000000000000000000001111

result:

ok "000000000000000000000000000000000000000000000001111"

Test #101:

score: 0
Accepted
time: 1ms
memory: 4912kb

input:

1
1000 50 50 50
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #102:

score: 0
Accepted
time: 4ms
memory: 4968kb

input:

1
1000 50 13279519896086620 27746363022538231
829900303738988 951660762109451 925796426544445 817010311750466 864024806601437 836756835898352 817327904920229 871780540836331 919580841730510 800350762661819 842723584052459 817386771995793 890945224296346 866773987565923 804156979946010 96964458130794...

output:

000000000000000000000000000000000000001111111111111

result:

ok "000000000000000000000000000000000000001111111111111"

Test #103:

score: 0
Accepted
time: 1ms
memory: 5112kb

input:

1
1000 50 5659090232148378 28522144394989131
941217006623930 990445006293773 969019149452214 942323884607496 902962803349036 955935746338053 987895163698792 958857182944247 907368561449443 919281526959066 943766494601522 922846817511228 903801018554220 932003418231252 971213721467905 939722567002948...

output:

000000000000000000000000000000000000000111111111111

result:

ok "000000000000000000000000000000000000000111111111111"

Test #104:

score: 0
Accepted
time: 3ms
memory: 5156kb

input:

1
1000 50 1999861148578154 30998641749541961
999946634907807 999930248606115 999928298404132 999960242214726 999928597991865 999991312388777 999933297695228 999958864596361 999985213295425 999948687828140 999967909880416 999994524679152 999908823774140 999977133989767 999908939228204 999902718464755...

output:

000000000000000000000000000000000000011111111111111

result:

ok "000000000000000000000000000000000000011111111111111"

Test #105:

score: 0
Accepted
time: 5ms
memory: 5112kb

input:

1
1000 50 4999999809960553 30999998379315194
999999957422577 999999974390601 999999990877274 999999927877610 999999904045159 999999923347809 999999931034310 999999969911499 999999912746064 999999902788000 999999978483943 999999928475622 999999982198845 999999968169237 999999945665270 999999922756448...

output:

000000000000000000000000000000000000001111111111111

result:

ok "000000000000000000000000000000000000001111111111111"

Test #106:

score: 0
Accepted
time: 2ms
memory: 5072kb

input:

1
1000 50 2999999999999035 30999999999983268
999999999999910 999999999999256 999999999999586 999999999999220 999999999999205 999999999999442 999999999999004 999999999999752 999999999999777 999999999999430 999999999999282 999999999999832 999999999999341 999999999999934 999999999999678 999999999999747...

output:

000000000000000000000000000000000000001111111111111

result:

ok "000000000000000000000000000000000000001111111111111"

Test #107:

score: 0
Accepted
time: 4ms
memory: 4980kb

input:

1
1000 50 800505830614748966 1000000000000000000
918918731863147601 905860690610753498 930459368873255613 851907531062995622 864201659241560099 824293143663752335 856058959598050116 825041326602499984 898031685497042021 816062126513619276 811803326385075617 941171044392247669 956062315844369948 8975...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #108:

score: 0
Accepted
time: 5ms
memory: 5004kb

input:

1
1000 50 990003968039492746 1000000000000000000
995154187164371551 994766575978892404 997371142638348389 996561525179932495 991635387680977404 996235149673514182 995413132112210534 995521536599619662 997689719966757419 997640528800934969 993921404777080896 998527105117190611 996642398174412036 9981...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #109:

score: 0
Accepted
time: 5ms
memory: 4860kb

input:

1
1000 50 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #110:

score: 0
Accepted
time: 3ms
memory: 4732kb

input:

100
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
10 9 50 50
50 50 50 50 50 50 50 50 50 50
1 2
1 3
1 4
1 5
1 6
1...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #111:

score: 0
Accepted
time: 3ms
memory: 4660kb

input:

100
10 9 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
10 9 100000000...

output:

0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
000...

result:

ok 100 tokens

Test #112:

score: 0
Accepted
time: 0ms
memory: 4824kb

input:

20
50 49 50 50
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 3...

output:

00000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000001
000000000000000000000000000000000000000000000...

result:

ok 20 tokens

Test #113:

score: 0
Accepted
time: 4ms
memory: 4872kb

input:

1
1000 50 1000000000000000000 1000000000000000000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000...

output:

000000000000000000000000000000000000000000000000000

result:

ok "000000000000000000000000000000000000000000000000000"

Test #114:

score: 0
Accepted
time: 1ms
memory: 4784kb

input:

1
19 6 3 5
1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
1 18
18 19

output:

0000000

result:

ok "0000000"

Test #115:

score: 0
Accepted
time: 1ms
memory: 4768kb

input:

100
10 4 0 50
23 10 11 17 3 17 2 21 9 42
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
31 0 0 1 3 2 1 0 3 0
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
24 30 8 13 3 1 18 4 1 33
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
0 17 6 18 20 2 6 6 20 4
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
2...

output:

00011
11111
00011
00111
00111
00111
00111
00011
00011
00011
01111
00111
00111
00111
00011
00111
00011
00111
00001
00111
00001
00011
01111
00111
00111
01111
01111
01111
00011
00011
01111
01111
00011
00011
00011
00111
00111
00111
00001
00111
00111
00001
00001
00001
00011
00111
00011
00111
00111
01111
...

result:

ok 100 tokens

Test #116:

score: 0
Accepted
time: 1ms
memory: 4744kb

input:

100
10 4 0 50
8 15 6 3 16 3 23 23 38 3
1 2
2 3
3 4
4 5
5 6
5 7
7 8
8 9
9 10
10 4 0 50
47 3 7 11 28 6 1 4 8 46
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
1 31 3 5 4 4 0 23 7 10
1 2
1 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
40 18 5 15 4 21 8 40 9 5
1 2
2 3
2 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 50
6...

output:

00011
00011
01111
00001
00111
00011
01111
00111
01111
00001
00111
00111
00011
00111
00011
00011
01111
00011
01111
00011
00111
00111
00111
01111
00111
00011
00001
00011
00011
00111
00011
00011
00011
00111
00111
00001
00011
00011
00111
01111
00001
00111
00111
00111
00011
00011
01111
00001
00011
00111
...

result:

ok 100 tokens

Test #117:

score: 0
Accepted
time: 3ms
memory: 4852kb

input:

100
10 4 40 50
48 2 13 11 5 13 49 6 43 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 40 50
3 16 22 13 33 50 45 16 16 11
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 40 50
38 6 45 3 2 5 9 31 48 45
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 40 50
39 4 8 32 7 43 14 21 15 42
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #118:

score: 0
Accepted
time: 3ms
memory: 4712kb

input:

100
10 4 40 50
9 37 29 12 33 9 4 4 48 43
1 2
2 3
3 4
4 5
5 6
6 7
6 8
8 9
9 10
10 4 40 50
43 0 7 39 8 12 25 42 14 31
1 2
2 3
2 4
4 5
5 6
5 7
7 8
8 9
9 10
10 4 40 50
44 47 25 15 3 39 10 26 2 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
7 9
8 10
10 4 40 50
47 15 29 39 4 15 28 4 38 6
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 ...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #119:

score: 0
Accepted
time: 4ms
memory: 4700kb

input:

100
10 4 49 50
43 5 1 25 24 6 44 50 44 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 49 50
1 49 12 17 13 7 49 49 14 36
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 49 50
50 18 8 24 49 8 31 2 9 49
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 49 50
5 44 50 7 3 40 0 49 46 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #120:

score: 0
Accepted
time: 1ms
memory: 4884kb

input:

100
10 4 49 50
4 30 15 49 50 9 20 1 20 49
1 2
2 3
3 4
4 5
5 6
6 7
7 8
6 9
9 10
10 4 49 50
5 44 32 17 3 47 27 11 11 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
7 9
9 10
10 4 49 50
3 25 21 49 20 30 29 17 3 50
1 2
1 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 49 50
49 50 27 23 2 16 5 14 13 49
1 2
2 3
3 4
4 5
5 6
5 7
6 8
8 ...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #121:

score: 0
Accepted
time: 0ms
memory: 4904kb

input:

100
10 2 0 50
23 2 8 4 1 0 0 3 0 45
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 0 50
0 6 3 2 0 1 4 2 1 0
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 0 50
20 1 12 9 9 13 6 19 7 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 0 50
10 5 9 41 0 1 1 0 1 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 0 50
0 1 1 1 0 ...

output:

011
111
001
011
111
001
011
001
011
011
001
011
011
111
011
001
011
011
011
111
011
011
001
011
111
011
011
011
011
011
111
111
001
011
111
011
001
011
001
001
111
011
011
001
001
001
011
011
011
011
111
011
011
111
011
011
011
011
111
011
011
011
011
011
001
011
011
011
011
111
001
011
111
001
001
...

result:

ok 100 tokens

Test #122:

score: 0
Accepted
time: 4ms
memory: 4800kb

input:

100
10 2 0 50
5 9 0 0 10 2 21 21 4 1
1 2
2 3
2 4
2 5
5 6
6 7
7 8
8 9
8 10
10 2 0 50
13 12 11 14 5 5 0 4 3 3
1 2
2 3
2 4
4 5
5 6
5 7
5 8
8 9
8 10
10 2 0 50
2 1 0 0 2 4 14 17 6 1
1 2
2 3
2 4
4 5
1 6
6 7
7 8
8 9
8 10
10 2 0 50
8 10 16 1 28 2 0 11 21 6
1 2
2 3
3 4
3 5
5 6
3 7
7 8
8 9
8 10
10 2 0 50
0 13...

output:

011
011
111
001
111
011
011
001
011
011
011
011
111
111
011
001
011
001
011
111
011
011
111
001
011
011
011
011
001
011
011
011
011
011
011
111
011
011
011
011
001
011
001
011
011
001
001
001
001
011
001
111
011
111
011
111
011
011
001
011
011
001
111
001
001
011
011
011
001
001
001
111
111
001
001
...

result:

ok 100 tokens

Test #123:

score: 0
Accepted
time: 3ms
memory: 4772kb

input:

100
10 2 40 50
31 15 15 3 19 3 0 10 34 12
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 40 50
1 39 14 34 0 0 15 15 12 6
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 40 50
0 6 31 4 0 23 15 2 14 31
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 40 50
6 6 12 14 11 49 3 7 8 31
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
1...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #124:

score: 0
Accepted
time: 0ms
memory: 4800kb

input:

100
10 2 40 50
22 10 6 2 41 6 5 22 4 6
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
7 10
10 2 40 50
6 8 3 20 3 5 11 26 21 23
1 2
1 3
2 4
2 5
5 6
6 7
7 8
8 9
9 10
10 2 40 50
7 16 2 18 7 12 3 1 22 48
1 2
1 3
3 4
4 5
5 6
6 7
5 8
7 9
9 10
10 2 40 50
20 24 1 8 7 0 5 1 26 44
1 2
1 3
3 4
4 5
4 6
4 7
7 8
7 9
9 10
10 2 4...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #125:

score: 0
Accepted
time: 3ms
memory: 4884kb

input:

100
10 2 49 50
44 5 9 7 8 9 9 8 20 29
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 50
50 5 8 20 0 17 0 33 8 8
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 50
2 1 5 3 27 11 8 40 1 49
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 50
2 27 4 17 1 6 3 4 36 50
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 5...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #126:

score: 0
Accepted
time: 2ms
memory: 4792kb

input:

100
10 2 49 50
42 7 1 13 3 9 10 7 7 50
1 2
2 3
3 4
3 5
3 6
4 7
4 8
4 9
9 10
10 2 49 50
11 8 9 21 1 39 10 44 1 4
1 2
1 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 50
9 4 6 31 12 3 35 10 24 15
1 2
1 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 49 50
11 2 10 26 49 13 23 2 4 8
1 2
2 3
1 4
4 5
5 6
6 7
6 8
8 9
6 10
10 ...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #127:

score: 0
Accepted
time: 3ms
memory: 4832kb

input:

100
10 4 0 1000000000000000000
609692487966649233 54820638171552164 213846149017135753 43617319689786714 21765454459489790 66280928006878573 41954267651844436 18853677504913381 809357199388692644 453649943819263629
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 0 1000000000000000000
893346420232961597 26...

output:

00111
00111
01111
00111
00111
00011
00111
00011
00011
00011
00001
00111
01111
00011
00011
00111
00011
00111
00001
00111
00111
00011
00111
00111
00011
00011
00001
00111
00111
00111
00111
00011
00111
00011
00111
00011
00111
01111
01111
01111
00111
00011
00011
00111
00111
01111
00111
00111
00001
00001
...

result:

ok 100 tokens

Test #128:

score: 0
Accepted
time: 4ms
memory: 4740kb

input:

100
10 4 0 1000000000000000000
223728927798649870 75501660883842116 69122054962972527 150951691565859802 529173978175605584 889083908835133383 603065928852999938 80125946576773638 292133356158275111 676341788592596804
1 2
2 3
2 4
4 5
5 6
6 7
7 8
7 9
9 10
10 4 0 1000000000000000000
817709524704933416...

output:

00001
00011
00111
00011
00111
01111
00111
00111
00111
00111
00111
00111
00111
00111
00011
00011
01111
00111
00111
00111
00001
00011
00111
00011
00001
01111
00011
00111
00011
00111
00001
00011
01111
01111
00111
01111
00011
00011
00111
00011
00111
01111
00011
01111
00011
00111
01111
00111
01111
00011
...

result:

ok 100 tokens

Test #129:

score: 0
Accepted
time: 0ms
memory: 4796kb

input:

100
10 4 800000000000000000 1000000000000000000
884191160989695138 412805929241789746 569052021595221941 599122673655973431 63892108332702370 285347760572516369 941265263915298174 564303680449269218 201985550292853104 152864748537492775
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 800000000000000000 10...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #130:

score: 0
Accepted
time: 3ms
memory: 4860kb

input:

100
10 4 800000000000000000 1000000000000000000
999296502703215094 741591946739145545 243058477995183572 108217719648752456 193115869758775941 240414955757863166 13461567970619867 294656590943334986 806066779294168465 804938545506153722
1 2
2 3
3 4
4 5
4 6
6 7
6 8
8 9
9 10
10 4 800000000000000000 10...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #131:

score: 0
Accepted
time: 3ms
memory: 4752kb

input:

100
10 4 999999999999999000 1000000000000000000
223459806210979587 776540193789019639 796227565860565704 203772434139433582 679417780214638619 320582219785361368 977669585030771389 22330414969227923 921911654641220547 78088345358779333
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 4 999999999999999000 100...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #132:

score: 0
Accepted
time: 3ms
memory: 4764kb

input:

100
10 4 999999999999999000 1000000000000000000
419591449639287004 580408550360712719 999999999999999759 614874807487604038 138840198971707536 246284993540688136 128864545430740498 375073634269486643 496061820299771875 999999999999999024
1 2
2 3
3 4
4 5
4 6
6 7
7 8
7 9
9 10
10 4 999999999999999000 1...

output:

00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
00001
...

result:

ok 100 tokens

Test #133:

score: 0
Accepted
time: 0ms
memory: 4808kb

input:

100
10 2 0 1000000000000000000
620443690169580 7634563423662375 275697767067313491 16725662029556014 26456301131819798 252779556038131476 24480624348095289 3063876932087908 454606643144464156 379135575604852947
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 0 1000000000000000000
29716549946131782 1042978...

output:

011
011
011
011
001
011
001
001
011
011
011
011
111
011
011
011
011
001
001
001
011
011
001
011
011
011
001
011
001
001
011
011
011
011
001
001
011
011
001
011
011
011
111
001
001
111
111
011
001
001
001
001
011
011
011
011
001
001
001
001
111
011
011
011
001
111
011
011
011
011
011
011
011
001
001
...

result:

ok 100 tokens

Test #134:

score: 0
Accepted
time: 0ms
memory: 4776kb

input:

100
10 2 0 1000000000000000000
8019805511696548 734874421133052211 81190772612723108 26832972726828637 149634065995073583 64294991474207508 77748463649832958 70829609173685787 11795237302406541 264172224794319752
1 2
2 3
3 4
3 5
5 6
6 7
7 8
7 9
8 10
10 2 0 1000000000000000000
8870160487572599 674372...

output:

011
011
011
111
011
011
011
001
111
011
011
011
011
011
011
111
011
001
011
011
001
011
001
001
111
011
011
111
111
011
111
011
111
001
001
011
111
011
011
011
111
001
001
011
011
011
011
011
111
001
001
111
001
001
011
111
011
001
001
011
001
111
111
011
011
111
011
011
011
011
011
001
111
011
001
...

result:

ok 100 tokens

Test #135:

score: 0
Accepted
time: 1ms
memory: 4772kb

input:

100
10 2 800000000000000000 1000000000000000000
183635422570928446 194804254299604161 587360200575242593 485275795043013790 414300744681350804 109034135936864554 246731647659063715 333237612205587411 266363416739147777 5275349119921799
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 800000000000000000 100...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #136:

score: 0
Accepted
time: 1ms
memory: 4852kb

input:

100
10 2 800000000000000000 1000000000000000000
179737999679703249 14740180613208223 652439534660643210 251761805671793936 597361541512104885 18328047410779466 415720563685869085 201472993687696751 124781200762895918 108870445893458746
1 2
1 3
3 4
4 5
5 6
6 7
7 8
8 9
7 10
10 2 800000000000000000 100...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #137:

score: 0
Accepted
time: 0ms
memory: 4700kb

input:

100
10 2 999999999999999000 1000000000000000000
999999999999999408 76770963976532732 923229036023466955 23892647713989414 119760997112353370 151023040320408192 76020691329493501 326085459598513893 187081680132740999 116135483792500178
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 2 999999999999999000 1000...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #138:

score: 0
Accepted
time: 2ms
memory: 4880kb

input:

100
10 2 999999999999999000 1000000000000000000
999999999999999924 103247717865727793 21494028518891207 217446252916099781 657812000699280687 228966833182276019 54932510262520003 418450469123757329 27067068180336638 270583119251109618
1 2
2 3
2 4
3 5
5 6
6 7
6 8
8 9
6 10
10 2 999999999999999000 1000...

output:

001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
001
...

result:

ok 100 tokens

Test #139:

score: 0
Accepted
time: 4ms
memory: 5168kb

input:

1
1000 2 0 50
0 0 0 1 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 2 0 0 0 1 0 0 1 0 2 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 3 1 0 0 0 0 1 1 0 1 0 0 0 0 2 0 0 2 0 0 0 1 2 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 1 2 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

011

result:

ok "011"

Test #140:

score: 0
Accepted
time: 2ms
memory: 4944kb

input:

1
1000 2 0 50
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 ...

output:

011

result:

ok "011"

Test #141:

score: 0
Accepted
time: 2ms
memory: 5088kb

input:

1
1000 2 40 50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

001

result:

ok "001"

Test #142:

score: 0
Accepted
time: 3ms
memory: 4860kb

input:

1
1000 2 40 50
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0...

output:

001

result:

ok "001"

Test #143:

score: 0
Accepted
time: 1ms
memory: 5052kb

input:

1
1000 2 49 50
0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 2 0 1 0 0 1 0 2 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 1 0 0 2 1 0 1 0 0 2 1 0 0 0 0 0 1 0 0 2 1 2 1 2 1 2 4 4 0 0 0 1 0 2 0 2 1 2 1 2 1 3 1 1 0 0 1 3 3 1 1 0 0 4 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1...

output:

001

result:

ok "001"

Test #144:

score: 0
Accepted
time: 4ms
memory: 4988kb

input:

1
1000 2 49 50
0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0...

output:

001

result:

ok "001"

Test #145:

score: 0
Accepted
time: 1ms
memory: 5092kb

input:

1
1000 2 0 1000000000000000000
3854414943034195 18511084150788811 6260166560270349 6270315460201838 4729987800766279 25669090191596644 1779506529501733 7185425925414897 5682285786072449 9397530663641986 4109681646813641 6362585341542635 15116090521125606 5437390926030202 2193873792199322 14449483255...

output:

011

result:

ok "011"

Test #146:

score: 0
Accepted
time: 4ms
memory: 4904kb

input:

1
1000 2 0 1000000000000000000
1602716838822861 2356114434142278 770369727379211 221969996763046 1125670179700914 305032527075124 3238103902692712 1655499393552724 1308780706221095 3490479560409084 1287075138268958 547382962177884 2024584413046607 185824027065349 1661737815315859 86448760415735 9961...

output:

011

result:

ok "011"

Test #147:

score: 0
Accepted
time: 4ms
memory: 5056kb

input:

1
1000 2 800000000000000000 1000000000000000000
768982053072890 675356309435890 3895783360835049 524587617078140 5496761706784124 8110564947402684 1072428640672527 3695427400824712 2757634237127447 995165703766843 6535024595212064 4336651838628849 3576044477076739 1365709103308001 3662587783062081 9...

output:

001

result:

ok "001"

Test #148:

score: 0
Accepted
time: 0ms
memory: 4960kb

input:

1
1000 2 800000000000000000 1000000000000000000
301818101597719 2571946037625621 545403477966290 230601232163381 178463187573859 102715242174102 1280058558374173 1287261151761993 3063953234378342 446637545461854 430774062248202 5026857606902016 746456386674364 1707339200390786 4264565067208477 37447...

output:

001

result:

ok "001"

Test #149:

score: 0
Accepted
time: 0ms
memory: 5060kb

input:

1
1000 2 999999999999999000 1000000000000000000
28765237111535126 15003127077621484 10585432232752403 12020232407334503 1601086468662956 12963371296808216 7239679605098867 2723792943412136 2228772216230283 4119510624681066 16786358165149627 42396296677570592 10734017681078122 9017170289319340 434980...

output:

001

result:

ok "001"

Test #150:

score: 0
Accepted
time: 0ms
memory: 4836kb

input:

1
1000 2 999999999999999000 1000000000000000000
5480574158408716 4633621593906574 3382149475775525 2596151037250856 4194715644350020 3604872393007073 247091071851968 1546885755636281 2293159769202272 4256863244188340 5249609468841478 1365614056283277 1066306711701260 1405184870224298 627510670654085...

output:

001

result:

ok "001"

Test #151:

score: 0
Accepted
time: 4ms
memory: 5244kb

input:

1
1000 4 0 50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

01111

result:

ok "01111"

Test #152:

score: 0
Accepted
time: 1ms
memory: 4932kb

input:

1
1000 4 0 50
0 0 0 0 1 0 0 0 1 0 0 0 2 1 2 0 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ...

output:

00111

result:

ok "00111"

Test #153:

score: 0
Accepted
time: 4ms
memory: 5224kb

input:

1
1000 4 40 50
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0...

output:

00001

result:

ok "00001"

Test #154:

score: 0
Accepted
time: 3ms
memory: 4992kb

input:

1
1000 4 40 50
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1...

output:

00001

result:

ok "00001"

Test #155:

score: 0
Accepted
time: 1ms
memory: 5036kb

input:

1
1000 4 49 50
0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 2 0 0 1 0 0 0 1 0 1 1 0 2 1 0 0 0 0 0 2 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 1...

output:

00001

result:

ok "00001"

Test #156:

score: 0
Accepted
time: 0ms
memory: 4864kb

input:

1
1000 4 49 50
0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0...

output:

00001

result:

ok "00001"

Test #157:

score: 0
Accepted
time: 5ms
memory: 5240kb

input:

1
1000 4 0 1000000000000000000
254895061860062 118129369093872 1017483414404854 427431180732279 178306331574581 589136806470930 221651786531158 1150840566711364 73516246915988 1148287929103 675637565678664 613621043409185 557728411393578 477419145425032 64305759510924 363335302426157 619406729639616...

output:

01111

result:

ok "01111"

Test #158:

score: 0
Accepted
time: 2ms
memory: 5032kb

input:

1
1000 4 0 1000000000000000000
1759120867104729 935830884658595 382894069012813 405138291281688 1581907280048340 625331606739454 683538900878854 26036601571728 55804073818319 239334781998669 23529237554589 170074625468463 2126067156853072 547080990534863 1093964922412563 157699463036893 984623278950...

output:

00111

result:

ok "00111"

Test #159:

score: 0
Accepted
time: 1ms
memory: 5048kb

input:

1
1000 4 800000000000000000 1000000000000000000
2008460157140862 4371107779350638 1716527983637045 1549223548838293 124407236165522 2807412080262200 456956855733110 3939694789944442 264404110915630 500633161428886 411202252985547 2347778667408102 324822900836524 281145204628284 1653582567197908 8710...

output:

00001

result:

ok "00001"

Test #160:

score: 0
Accepted
time: 0ms
memory: 4884kb

input:

1
1000 4 800000000000000000 1000000000000000000
4679965846579382 10538179972504139 2924754836257616 15558827799618093 12953651948948617 12737681965509677 16456114731768014 9073985914146398 2529303767893131 3853853407716144 503783616984300 7088515146203146 14838000336902701 3041549663776644 323180322...

output:

00001

result:

ok "00001"

Test #161:

score: 0
Accepted
time: 0ms
memory: 4996kb

input:

1
1000 4 999999999999999000 1000000000000000000
45020919469187427 21861351731906509 7870994858600638 1181445624413483 2775655341353281 1509682984895208 11290623502088228 9237111922426151 7263843387596670 90120235987875 23501442610128721 28221723844431383 12030375389210247 1878612536064813 4284885291...

output:

00001

result:

ok "00001"

Test #162:

score: 0
Accepted
time: 3ms
memory: 4868kb

input:

1
1000 4 999999999999999000 1000000000000000000
17338693535388307 3205253176632801 22111654485618733 23789439008440138 25137430735556515 2695368873049339 43950607088488610 6605284642925497 8816769852950458 25170524667115442 40912528076203594 221104315256578207 19782406532744605 13310148122203468 501...

output:

00001

result:

ok "00001"

Test #163:

score: 0
Accepted
time: 4ms
memory: 5376kb

input:

1
1000 9 0 50
0 0 1 1 2 1 2 1 2 1 1 2 1 2 0 2 2 2 1 0 1 0 0 0 1 1 2 0 0 1 0 0 1 2 1 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0000111111

result:

ok "0000111111"

Test #164:

score: 0
Accepted
time: 5ms
memory: 5064kb

input:

1
1000 9 0 50
0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 ...

output:

0000001111

result:

ok "0000001111"

Test #165:

score: 0
Accepted
time: 4ms
memory: 5192kb

input:

1
1000 9 40 50
0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0...

output:

0000000001

result:

ok "0000000001"

Test #166:

score: 0
Accepted
time: 1ms
memory: 4884kb

input:

1
1000 9 40 50
0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0...

output:

0000000001

result:

ok "0000000001"

Test #167:

score: 0
Accepted
time: 4ms
memory: 5092kb

input:

1
1000 9 49 50
0 0 1 0 0 0 4 1 0 2 0 1 2 1 0 0 2 1 0 1 1 1 2 1 0 1 1 1 0 0 1 0 1 5 0 1 0 1 2 1 0 0 1 1 1 1 1 2 0 4 1 1 1 0 0 0 1 0 0 0 0 2 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 2 0 0 0 1 0 1 0 0 2 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0...

output:

0000000001

result:

ok "0000000001"

Test #168:

score: 0
Accepted
time: 3ms
memory: 4932kb

input:

1
1000 9 49 50
0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 2 0 1 1 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0...

output:

0000000001

result:

ok "0000000001"

Test #169:

score: 0
Accepted
time: 2ms
memory: 5316kb

input:

1
1000 9 0 1000000000000000000
183489882251840 259674964020677 97596790484464 225966533151426 241094511321622 137581809859870 15353473892803 415496769236422 318139818231242 7897969331424 37565485580887 202053704195039 136692818746657 317611672909781 67080985520932 66485048192485 64375862847614 13144...

output:

0000011111

result:

ok "0000011111"

Test #170:

score: 0
Accepted
time: 5ms
memory: 5108kb

input:

1
1000 9 0 1000000000000000000
9092601141291430 2306866529059933 2810627635061472 1795985533790101 21554104385239556 2209830114945437 18857059941565753 7068755004530013 7411468284232751 34822971200830912 28042344286928850 11116580539791941 5365816457849940 18058270039643066 4708582781836007 32335081...

output:

0000011111

result:

ok "0000011111"

Test #171:

score: 0
Accepted
time: 4ms
memory: 5088kb

input:

1
1000 9 800000000000000000 1000000000000000000
5621631497885722 8727328546038229 6028569625064232 14628036759518700 21533094367284899 176476239605351 7435385571729715 1474760916744860 2630778833578829 2924743205362811 7948453025236499 7975340992206628 25157564757687405 4310543804353868 317281283911...

output:

0000000001

result:

ok "0000000001"

Test #172:

score: 0
Accepted
time: 4ms
memory: 4880kb

input:

1
1000 9 800000000000000000 1000000000000000000
5291374142234425 1943430564761861 1517744364384959 2437461933728287 4168322235918412 3011193215095434 2761226724027440 10391235135258217 4306042998183916 4448416637561593 188671275172770 17947495016652705 2245695491430692 2697931980643705 2934958344578...

output:

0000000001

result:

ok "0000000001"

Test #173:

score: 0
Accepted
time: 3ms
memory: 5016kb

input:

1
1000 9 999999999999999000 1000000000000000000
7164785248263510 751144106381022 7650734641976813 4325742915923568 20351879908578635 11136796263006259 4795886189129796 4888998168365482 5083648172732309 11733255363715507 8207264281428869 3091533745830419 16633952825474028 17468360104075248 1274619613...

output:

0000000001

result:

ok "0000000001"

Test #174:

score: 0
Accepted
time: 3ms
memory: 4868kb

input:

1
1000 9 999999999999999000 1000000000000000000
120275364470561726 44954897354820039 101107543785717244 40257841994272630 111149554469178558 9243281311269901 45501550677898693 117065492574292221 63155699962510211 136095194995077819 31901847853917930 84715163505499891 51893299208623373 42683267836359...

output:

0000000001

result:

ok "0000000001"

Test #175:

score: 0
Accepted
time: 7ms
memory: 5748kb

input:

1
1000 19 0 50
0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 1 3 6 2 2 1 2 2 0 3...

output:

00000000000011111111

result:

ok "00000000000011111111"

Test #176:

score: 0
Accepted
time: 5ms
memory: 5152kb

input:

1
1000 19 0 50
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 4 0 1 1 2 0 0 0 4 1 1 1 1 1 0 1 5 1 0 2 0 1 1 4 0 2 0 1 3 0 4 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 2 0 0 1 0 0 0 1 0 0 0 0 0 0 0...

output:

00000000001111111111

result:

ok "00000000001111111111"

Test #177:

score: 0
Accepted
time: 4ms
memory: 5012kb

input:

1
1000 19 40 50
0 3 0 2 2 1 2 0 1 1 2 1 2 1 0 1 1 0 1 2 1 3 0 1 3 1 0 2 3 1 1 1 0 0 1 0 0 3 0 3 1 0 1 1 0 3 1 2 1 1 0 1 0 0 0 0 1 1 0 1 1 1 0 1 3 0 1 3 0 1 0 1 1 0 0 1 1 1 1 0 0 2 1 1 2 1 2 1 3 1 2 4 1 0 3 0 0 1 1 3 2 1 1 0 1 1 3 0 6 3 1 1 1 1 2 28 1 17 1 3 0 1 1 3 0 4 3 6 0 2 0 3 0 0 2 1 2 0 1 1 7 ...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #178:

score: 0
Accepted
time: 3ms
memory: 4844kb

input:

1
1000 19 40 50
2 1 5 0 3 4 0 0 3 7 2 16 6 0 2 1 2 3 2 1 0 0 3 0 1 0 1 0 4 0 0 2 4 3 3 0 3 2 0 7 0 0 1 0 3 0 1 1 0 0 2 1 3 0 1 0 0 0 0 3 0 1 2 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 3 0 1 1 1 0 1 0 0 1 0 0 0 1 0 2 3 0 1 1 1 0 0 8 9 8 5 2 15 3 46 3 0 2 2 1 0 1 2 2 3 5 1 2 1 1 1 1 1 1 1 6 1 0 2 3 0 1 0 2 0...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #179:

score: 0
Accepted
time: 1ms
memory: 5104kb

input:

1
1000 19 49 50
2 8 11 1 1 2 1 3 0 3 13 4 2 1 1 0 1 0 1 1 2 0 0 1 0 0 1 0 0 1 1 1 0 1 3 1 2 2 1 0 1 0 0 3 0 1 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 2 0 1 1 1 1 1 0 0 1 1 0 0 1 2 0 0 1 1 1 0 0 0 3 2 0 1 1 1 0 3 1 6 2 1 1 0 0 2 0 0 1 0 2 1 0 0 3 1 2 0 2 0 3 2 2 1 0 0 3 0 0 15 8 4 9 1 12 0 0 1 2 3 0 0 ...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #180:

score: 0
Accepted
time: 1ms
memory: 4968kb

input:

1
1000 19 49 50
1 4 0 1 3 0 2 4 0 3 0 1 2 1 1 4 0 1 1 2 0 0 1 2 1 0 1 0 2 2 1 2 0 2 0 0 1 1 2 0 0 0 0 1 0 2 0 0 1 0 1 1 0 1 0 2 4 0 2 0 0 2 2 1 1 0 1 0 1 0 2 0 1 0 0 0 1 3 1 1 1 0 1 2 1 4 0 0 3 0 0 3 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 0 0 2 0 5 0 1 0 1 0 1 0 0 1 0 0 0 1 1 ...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #181:

score: 0
Accepted
time: 7ms
memory: 5748kb

input:

1
1000 19 0 1000000000000000000
15388569702119118 4723815191103162 23336829182919519 10385305104869250 844031683171439 6359177638911413 9959787084588843 21971769775201096 20786162802151613 7144825454778110 12825398518220566 4118318334775120 14193309071833662 1765095933184026 1689957401825164 5363189...

output:

00000000011111111111

result:

ok "00000000011111111111"

Test #182:

score: 0
Accepted
time: 1ms
memory: 5112kb

input:

1
1000 19 0 1000000000000000000
8178961652391338 7260366996110074 3486730447808042 4181435397381158 3581285808170139 4918666761350220 8125689674608341 5525793083749293 8816218812188367 2586763385960965 5836333475140843 1636512265174280 49707552946868 7080913251389313 3937838781480623 583821849013669...

output:

00000000000111111111

result:

ok "00000000000111111111"

Test #183:

score: 0
Accepted
time: 5ms
memory: 5228kb

input:

1
1000 19 800000000000000000 1000000000000000000
75679625089900 11244189900182064 4397153658811763 49651353381841666 15530282208907437 16533644084747510 18410053286889673 18793930881831040 615437613654195 41599940034056231 21712960407472674 35173153847313049 1875627777598384 35743449811379162 122353...

output:

00000000000000000011

result:

ok "00000000000000000011"

Test #184:

score: 0
Accepted
time: 2ms
memory: 4936kb

input:

1
1000 19 800000000000000000 1000000000000000000
2064467683405331 4238828031402100 998036055573890 16349126978967014 4989813333919757 6368128176977271 12716693370444497 11167485749226158 8055028471694014 911221894365926 3078709769187779 4480260304045342 8773686076646969 1030069002139108 117397833864...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #185:

score: 0
Accepted
time: 4ms
memory: 5172kb

input:

1
1000 19 999999999999999000 1000000000000000000
50884146785835326 1849301793797439 190130566169985098 148425689746788922 56005693063951750 21279805303655255 116092168802125480 9798270551682044 34196667011190254 145211873171039696 63689033814345049 46544433882633812 16463141965869170 994292079371003...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #186:

score: 0
Accepted
time: 1ms
memory: 4840kb

input:

1
1000 19 999999999999999000 1000000000000000000
6179538305040377 16458467827109350 7891875549317580 2052963593154840 611257608542309 4297079333007248 2448462402733164 5069909889994747 9149525449039681 14592517983805277 13170794698261372 7174673929588543 230608161360227 16735167821649679 12648507600...

output:

00000000000000000001

result:

ok "00000000000000000001"

Test #187:

score: 0
Accepted
time: 3ms
memory: 6756kb

input:

1
1000 49 0 50
0 0 2 1 3 0 1 2 0 1 2 6 2 1 3 8 0 2 0 2 0 2 1 0 0 1 1 1 2 1 0 3 0 0 0 5 3 1 6 4 6 1 0 2 1 2 3 3 3 4 2 0 0 1 1 0 1 0 1 0 0 1 0 3 2 1 0 1 1 5 0 1 0 1 0 0 1 1 1 1 1 1 3 12 3 3 6 1 2 1 3 0 0 5 0 1 2 2 1 1 0 1 1 1 0 0 1 1 2 0 1 0 0 1 0 3 1 0 2 15 8 14 5 2 1 1 0 0 1 0 2 4 0 0 0 1 1 0 0 1 0 ...

output:

00000000000000000000000001111111111111111111111111

result:

ok "00000000000000000000000001111111111111111111111111"

Test #188:

score: 0
Accepted
time: 9ms
memory: 5528kb

input:

1
1000 49 0 50
4 1 5 2 1 2 6 8 0 2 1 1 0 0 0 2 0 0 1 0 0 1 0 4 0 2 0 2 0 1 0 0 0 2 4 2 8 0 3 3 2 0 8 4 0 0 0 0 1 0 2 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 2 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 2 1 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0...

output:

00000000000000000000000000000001111111111111111111

result:

ok "00000000000000000000000000000001111111111111111111"

Test #189:

score: 0
Accepted
time: 0ms
memory: 5180kb

input:

1
1000 49 40 50
0 0 3 2 1 0 2 0 0 2 2 0 3 0 2 2 1 1 1 4 1 0 1 0 4 1 4 0 1 3 0 0 0 5 5 4 10 4 7 8 1 3 41 1 2 5 3 0 2 9 10 5 2 8 0 2 2 2 8 6 4 0 4 0 3 0 3 5 0 2 3 0 20 13 1 7 4 5 18 1 12 3 3 0 5 1 18 2 1 3 3 0 3 1 4 0 1 3 8 2 0 2 8 17 3 2 1 2 5 5 1 2 6 3 3 1 3 0 2 2 3 0 1 1 0 1 1 1 1 0 2 1 0 1 0 0 0 1...

output:

00000000000000000000000000000000000000000000000011

result:

ok "00000000000000000000000000000000000000000000000011"

Test #190:

score: 0
Accepted
time: 2ms
memory: 4844kb

input:

1
1000 49 40 50
0 0 0 0 2 1 2 2 1 1 0 4 0 1 0 1 0 0 1 2 2 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 0 1 7 0 0 2 1 0 1 2 1 0 1 1 1 2 1 3 0 2 3 0 4 0 1 0 1 2 0 1 3 1 1 0 1 1 2 2 1 1 2 1 3 0 1 0 2 1 7 2 1 1 4 1 3 0 3 2 1 1 1 0 0 1 1 4 0 4 46 0 1 1 0 5 2 1 1 0 2 1 2 0 2 0 2 2 1 1 1 1 0 0 2 1 0 2 1 0 1 1 1 3...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"

Test #191:

score: 0
Accepted
time: 1ms
memory: 5128kb

input:

1
1000 49 49 50
4 17 3 1 7 0 10 7 1 0 3 3 3 4 2 0 0 0 0 5 0 2 4 1 3 9 1 9 0 11 2 1 3 7 7 0 5 5 2 2 5 6 6 12 0 1 1 8 1 2 3 0 1 4 4 0 11 1 13 7 3 1 2 4 2 3 2 4 1 8 0 7 4 13 3 3 6 9 10 22 6 3 50 1 1 1 0 1 0 1 1 3 0 3 1 2 2 3 1 2 3 1 1 0 2 2 3 1 2 2 2 1 1 0 3 0 0 2 1 0 2 1 1 0 0 1 0 0 0 1 1 2 2 1 1 3 5 ...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"

Test #192:

score: 0
Accepted
time: 4ms
memory: 4880kb

input:

1
1000 49 49 50
8 22 12 7 1 1 0 1 3 0 0 0 0 1 0 0 1 0 0 3 0 0 1 0 2 1 1 0 1 1 0 1 1 1 3 1 0 2 0 1 1 0 0 2 0 0 1 0 0 0 2 1 2 1 0 0 1 1 2 2 0 0 2 2 1 0 1 0 0 0 0 2 2 0 5 2 1 0 4 1 8 3 10 1 2 9 0 3 3 1 2 2 1 3 6 0 4 3 2 9 5 0 2 2 1 1 0 0 0 2 4 0 0 6 0 2 7 9 0 2 3 1 0 9 5 18 9 8 14 0 2 1 2 0 3 1 0 1 1 3...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"

Test #193:

score: 0
Accepted
time: 4ms
memory: 6440kb

input:

1
1000 49 0 1000000000000000000
14295320092388468 8587552054831727 25272362722261402 3833551183780338 7981207415400159 1470721469915969 20597441423847872 7983935939928792 459196693612896 9367881723655655 2273403137466629 363336076779582 1463927395312735 12775110055126489 2375202924586240 98790920997...

output:

00000000000000000000000000000001111111111111111111

result:

ok "00000000000000000000000000000001111111111111111111"

Test #194:

score: 0
Accepted
time: 0ms
memory: 5460kb

input:

1
1000 49 0 1000000000000000000
13822433715632401 111031797145287567 58259642454437153 46160766675383255 14031560203756085 77913790816536174 31871670415578997 78969216731384749 31558181449460 19330830744919926 33509651854347038 16327663645534183 33042856591904162 15406932460776896 12807717566068398 ...

output:

00000000000000000000000000000011111111111111111111

result:

ok "00000000000000000000000000000011111111111111111111"

Test #195:

score: 0
Accepted
time: 5ms
memory: 5196kb

input:

1
1000 49 800000000000000000 1000000000000000000
351968495538088593 123508471062456229 171558753431630815 118900209355419400 171847337283804252 144545129457087289 145042704911846563 234154597868081381 253459287661447617 117289186441628531 160458347287675643 360979516353119781 187176681544029089 1581...

output:

00000000000000000000000000000000000000000000000111

result:

ok "00000000000000000000000000000000000000000000000111"

Test #196:

score: 0
Accepted
time: 0ms
memory: 4920kb

input:

1
1000 49 800000000000000000 1000000000000000000
93864354211170680 467828020395373885 116598214388409238 25620106399444772 63551801854829181 111628497439874760 29475221423663191 40419210731815862 134415328537422418 30423419746389822 99496452457128234 59326946797710251 48326062880147684 1421174480447...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"

Test #197:

score: 0
Accepted
time: 4ms
memory: 5088kb

input:

1
1000 49 999999999999999000 1000000000000000000
76442364510929915 152912120529616624 32956947381046714 51235421166305963 18183985878743701 389846282832378066 143036134987791894 135386742713186796 37223734477189040 6396693934858483 14222355809713391 9761260419822614 24988374537644945 141429090113445...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"

Test #198:

score: 0
Accepted
time: 0ms
memory: 4956kb

input:

1
1000 49 999999999999999000 1000000000000000000
193048479165105253 80757420985560284 212820331643224913 33581427456031247 148621164548058568 101234785324552875 72481874633490944 49771935169592514 107682581074382666 18467900585196714 870345223115672 7826481664945454 55007880538744214 147496314572142...

output:

00000000000000000000000000000000000000000000000001

result:

ok "00000000000000000000000000000000000000000000000001"