QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#710669#5140. Frozen ScoreboardkalikariAC ✓32ms3948kbC++174.1kb2024-11-04 20:58:162024-11-04 20:58:21

Judging History

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

  • [2024-11-04 20:58:21]
  • 评测
  • 测评结果:AC
  • 用时:32ms
  • 内存:3948kb
  • [2024-11-04 20:58:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
/*
ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
*/
// #define int long long
#define ld long double
//#define INT __int128
#define eb(x) emplace_back(x)
#define fi first
#define se second
#define sc(x) scanf("%d",&x)
#define SC(x) scanf("%lld",&x)
#define reserve reserve
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<long long, long long> PLL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
const LL INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const LL mod = 1e9 + 7;
const ld eps = 1e-12;
const int N = 1e3 + 10, M = 13 + 10;
int n,m,nw;
struct TL{
    char op[2];
    int x,y;
    int pos,fg;
}tl[M],ans[M];
bool vis[M];
int a,b;

int dfs(int u,int liml,int limr,int cn){
    if(u>nw){
        // for(int i=1;i<=nw;i++){
        //     cout<<vis[i]<<" ";
        // }
        // cout<<endl;
        // cout<<"__________=====_   "<<liml<<" "<<limr<<" "<<b<<endl;
        if(liml<=b&&b<=limr&&cn==a)return 1;
        return 0;
    }
    int ret=dfs(u+1,liml,limr,cn);
    if(ret)return 1;

    int nw_liml=liml+(tl[u].y-tl[u].x)*20+240, nw_limr=limr+(tl[u].y-1)*20+299;
    // cout<<"++++++++++  "<<" "<<tl[u].y<<" "<<tl[u].x<<" "<<(tl[u].y-tl[u].x)*20+240<<endl;
    vis[u]=1;
    ret=dfs(u+1,nw_liml,nw_limr,cn+1);
    if(ret)return 1;
    vis[u]=0;
    
    return 0;
}

void solve(){
    nw=0;
    memset(vis,0,sizeof vis);

    scanf("%d%d",&a,&b);
    for(int i=1;i<=m;i++){
        tl[i].fg=0;
        scanf("%s",tl[i].op);
        if(tl[i].op[0]=='+'){
            scanf("%d/%d",&tl[i].x,&tl[i].y);
        }
        else if(tl[i].op[0]=='-'){
            scanf("%d",&tl[i].x);
        }
        else if(tl[i].op[0]=='?'){
            scanf("%d%d",&tl[i].x,&tl[i].y);
            tl[i].fg=1;
        }
        tl[i].pos=i;
    }
    sort(tl+1,tl+1+m,[](const TL&a,const TL&b){
        return a.fg>b.fg;
    });

    // cout<<"+__++_____________"<<a<<" "<<b<<endl;

    for(int i=1;i<=m;i++){
        ans[i]=tl[i];
        if(tl[i].op[0]=='?')nw++;
        else{
            int tim=0;
            if(tl[i].op[0]=='+'){
                a--;
                tim+=20*(tl[i].x-1)+tl[i].y;
            }
            b-=tim;
        }
    }

    // cout<<"_________________"<<a<<" "<<b<<" "<<nw<<endl;

    int fg=dfs(1,0,0,0);
    
    if(!fg){
        puts("No");
        return;
    }
    // for(int i=1;i<=m;i++){
    //     cout<<vis[i]<<" ";
    // }
    // cout<<endl;


    int p=b;
    for(int i=1;i<=nw;i++){
        if(vis[i]){
            ans[i].op[0]='+';
            ans[i].x=tl[i].y-tl[i].x+1;
            ans[i].y=240;
            p-=(tl[i].y-tl[i].x)*20+240;
        }
        else{
            ans[i].op[0]='-';
            ans[i].x=tl[i].y;
        }
    }
    // cout<<"_________"<<p<<endl;
    for(int i=1;i<=nw;i++){
        if(vis[i]){
            int t=tl[i].x-1;
            // cout<<"+++----------- ---____"<<i<<" "<<t<<" "<<p<<endl;
            while(p>=20&&t){
                ans[i].x++;
                p-=20;
                t--;
            }
            if(p&&ans[i].y<299){
                int t=min(p,299-ans[i].y);
                ans[i].y+=t;
                p-=t;
            }
        }
    }

    // cout<<"_________"<<p<<endl;
    // if(p<20){
    //     ans[nw].y+=p;
    //     p-=p;
    // }
    // if(p!=0){
    //     puts("No");
    //     return;
    // }

    sort(ans+1,ans+1+m,[](const TL&a,const TL&b){
        return a.pos<b.pos;
    });
    puts("Yes");
    for(int i=1;i<=m;i++){
        printf("%c ",ans[i].op[0]);
        if(ans[i].op[0]=='+'){
            printf("%d/%d\n",ans[i].x,ans[i].y);
        }
        else if(ans[i].op[0]=='-'){
            printf("%d\n",ans[i].x);
        }
        else{
            printf("\n");
        }
    }
}

signed main(){
    // ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    int T=1,cas=1;
    cin>>T;
    cin>>m;
    while(T--){
        solve();
    }
    return 0;
}

詳細信息

Test #1:

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

input:

1 13
7 951
+ 1/6
? 3 4
+ 4/183
- 2
+ 3/217
.
.
.
+ 2/29
+ 1/91
.
+ 1/22
.

output:

Yes
+ 1/6
+ 3/243
+ 4/183
- 2
+ 3/217
. 
. 
. 
+ 2/29
+ 1/91
. 
+ 1/22
. 

result:

ok ok (1 test case)

Test #2:

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

input:

6 2
1 100
.
? 3 4
2 100
+ 1/1
+ 1/2
0 0
- 5
- 6
2 480
? 100 100
? 100 100
2 480
? 99 100
? 100 100
1 2000
? 100 100
? 100 100

output:

No
No
Yes
- 5
- 6
Yes
+ 1/240
+ 1/240
No
Yes
- 100
+ 89/240

result:

ok ok (6 test cases)

Test #3:

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

input:

1000 13
6 1519
+ 3/183
- 1
+ 9/133
? 2 3
- 5
? 1 3
- 5
? 1 1
? 1 3
- 5
+ 1/165
- 6
? 2 5
2 570
- 2
- 9
.
- 1
- 7
- 6
+ 4/179
- 2
? 2 5
.
- 2
? 1 3
.
1 140
.
- 2
.
- 2
- 1
- 2
- 2
.
.
.
.
+ 3/100
.
1 195
+ 1/195
.
.
.
.
.
.
.
.
? 1 1
.
.
.
0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
3 776
? 8 22
? 1 8
- 6
+ 1/173
...

output:

Yes
+ 3/183
- 1
+ 9/133
- 3
- 5
- 3
- 5
+ 1/258
+ 3/240
- 5
+ 1/165
- 6
+ 4/240
Yes
- 2
- 9
. 
- 1
- 7
- 6
+ 4/179
- 2
- 5
. 
- 2
+ 3/291
. 
Yes
. 
- 2
. 
- 2
- 1
- 2
- 2
. 
. 
. 
. 
+ 3/100
. 
Yes
+ 1/195
. 
. 
. 
. 
. 
. 
. 
. 
- 1
. 
. 
. 
Yes
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
Yes
- 22
- 8
-...

result:

ok ok (1000 test cases)

Test #4:

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

input:

1000 13
0 0
.
.
.
- 1
.
- 5
.
- 2
- 2
- 1
- 9
- 2
.
0 0
- 7
- 1
? 2 2
- 2
- 4
.
- 1
- 3
- 6
- 1
? 4 6
.
- 1
2 480
+ 4/120
- 3
- 5
.
- 11
- 1
- 4
- 4
- 3
? 13 22
.
+ 9/140
? 1 5
3 465
.
.
.
+ 1/124
.
+ 1/139
.
.
+ 1/202
.
.
.
.
3 885
- 1
- 4
- 4
+ 4/158
.
+ 9/138
? 1 8
.
? 1 3
.
- 4
? 2 5
.
6 970
- 4...

output:

Yes
. 
. 
. 
- 1
. 
- 5
. 
- 2
- 2
- 1
- 9
- 2
. 
Yes
- 7
- 1
- 2
- 2
- 4
. 
- 1
- 3
- 6
- 1
- 6
. 
- 1
Yes
+ 4/120
- 3
- 5
. 
- 11
- 1
- 4
- 4
- 3
- 22
. 
+ 9/140
- 5
Yes
. 
. 
. 
+ 1/124
. 
+ 1/139
. 
. 
+ 1/202
. 
. 
. 
. 
Yes
- 1
- 4
- 4
+ 4/158
. 
+ 9/138
- 8
. 
- 3
. 
- 4
+ 5/289
. 
No
Yes
- 2...

result:

ok ok (1000 test cases)

Test #5:

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

input:

1000 13
5 1620
- 2
- 1
? 2 4
? 4 5
+ 6/213
.
+ 6/231
? 2 4
+ 7/215
.
.
? 2 6
? 1 1
2 975
? 1 4
- 2
- 6
.
? 2 12
? 1 4
? 2 7
- 3
- 1
? 2 19
? 2 2
- 2
? 1 1
0 0
.
.
- 3
- 1
.
- 1
- 4
.
- 1
.
- 1
- 1
- 3
4 1342
.
- 6
- 2
- 4
- 8
- 6
+ 14/95
? 2 2
? 1 9
? 6 10
- 7
+ 4/205
? 3 5
5 1019
.
.
.
+ 2/116
.
- ...

output:

Yes
- 2
- 1
- 4
- 5
+ 6/213
. 
+ 6/231
- 4
+ 7/215
. 
. 
+ 6/299
+ 1/242
Yes
- 4
- 2
- 6
. 
- 12
- 4
- 7
- 3
- 1
+ 19/299
+ 2/296
- 2
- 1
Yes
. 
. 
- 3
- 1
. 
- 1
- 4
. 
- 1
. 
- 1
- 1
- 3
Yes
. 
- 6
- 2
- 4
- 8
- 6
+ 14/95
- 2
- 9
+ 10/262
- 7
+ 4/205
+ 3/240
Yes
. 
. 
. 
+ 2/116
. 
- 1
+ 3/127
. 
...

result:

ok ok (1000 test cases)

Test #6:

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

input:

1000 13
0 0
.
.
.
.
- 1
.
? 1 4
.
.
- 1
.
.
- 1
5 1008
- 2
- 2
.
+ 4/157
.
.
+ 2/145
- 3
+ 2/125
.
+ 1/233
+ 4/188
- 5
0 0
.
.
? 1 1
.
.
.
.
.
.
.
.
.
.
6 1359
+ 1/100
+ 2/144
- 4
+ 2/238
- 2
- 2
+ 4/107
+ 4/214
.
? 3 6
+ 9/236
- 4
- 6
8 3064
+ 20/155
.
- 17
- 11
? 9 10
? 11 30
- 1
? 6 13
+ 6/113
+ ...

output:

Yes
. 
. 
. 
. 
- 1
. 
- 4
. 
. 
- 1
. 
. 
- 1
Yes
- 2
- 2
. 
+ 4/157
. 
. 
+ 2/145
- 3
+ 2/125
. 
+ 1/233
+ 4/188
- 5
Yes
. 
. 
- 1
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
Yes
+ 1/100
+ 2/144
- 4
+ 2/238
- 2
- 2
+ 4/107
+ 4/214
. 
- 6
+ 9/236
- 4
- 6
Yes
+ 20/155
. 
- 17
- 11
+ 10/299
- 30
- 1
+ 12/243
+ 6/1...

result:

ok ok (1000 test cases)

Test #7:

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

input:

1000 13
2 501
? 1 8
- 1
+ 4/208
- 5
- 1
- 19
+ 4/173
- 11
.
- 11
? 1 1
.
- 10
4 599
- 2
.
- 12
.
+ 1/142
+ 3/85
- 3
? 4 8
+ 4/80
.
- 1
.
+ 3/152
13 3774
? 2 7
? 2 3
+ 12/162
+ 2/112
+ 4/174
+ 12/156
+ 2/163
+ 2/168
+ 12/186
+ 6/191
+ 8/43
? 1 2
? 1 16
8 2408
? 2 5
? 1 1
? 6 14
+ 4/204
.
+ 2/97
+ 2/2...

output:

Yes
- 8
- 1
+ 4/208
- 5
- 1
- 19
+ 4/173
- 11
. 
- 11
- 1
. 
- 10
Yes
- 2
. 
- 12
. 
+ 1/142
+ 3/85
- 3
- 8
+ 4/80
. 
- 1
. 
+ 3/152
No
Yes
+ 5/299
+ 1/299
+ 11/244
+ 4/204
. 
+ 2/97
+ 2/222
+ 10/230
. 
- 7
. 
- 1
+ 2/233
Yes
. 
- 8
- 4
- 4
- 2
. 
- 7
. 
. 
- 10
- 5
- 3
- 4
Yes
- 5
+ 1/173
. 
- 2
- ...

result:

ok ok (1000 test cases)

Test #8:

score: 0
Accepted
time: 30ms
memory: 3904kb

input:

1000 13
1 19917
? 30 39
? 79 81
? 32 33
? 35 95
? 14 84
? 6 17
? 11 31
? 5 8
? 34 89
? 38 50
? 10 10
? 22 54
? 5 92
1 16730
? 56 59
? 40 55
? 42 54
? 5 9
? 65 79
? 7 11
? 25 34
? 2 10
? 29 51
? 2 7
? 39 48
? 4 67
? 24 36
8 17772
? 17 35
? 36 46
? 42 63
? 2 11
? 59 84
? 4 36
? 9 21
? 76 86
? 48 89
? ...

output:

No
No
No
Yes
- 95
- 22
- 22
- 93
- 8
- 8
+ 80/299
- 40
- 60
+ 38/299
- 25
+ 99/299
+ 48/242
No
No
No
Yes
- 54
- 31
- 52
- 11
- 20
+ 74/299
+ 14/299
+ 86/299
+ 96/299
+ 65/245
+ 6/240
+ 35/240
+ 19/240
No
Yes
- 75
- 52
- 27
- 3
- 9
- 89
- 17
- 79
- 44
+ 71/299
+ 39/288
+ 43/240
- 12
No
No
No
No
No
Ye...

result:

ok ok (1000 test cases)

Test #9:

score: 0
Accepted
time: 30ms
memory: 3948kb

input:

1000 13
11 8761
? 14 96
? 9 35
? 12 16
? 28 55
? 2 27
? 6 7
? 17 50
? 25 31
? 4 11
? 62 98
? 10 19
? 3 3
? 9 13
6 12408
? 46 73
? 22 46
? 24 66
? 19 43
? 13 17
? 2 3
? 14 23
? 6 6
? 61 67
? 17 25
? 1 62
? 59 64
? 2 32
10 4393
? 11 90
? 19 58
? 61 98
? 42 43
? 55 69
? 32 35
? 26 70
? 2 5
? 14 65
? 16...

output:

Yes
- 96
- 35
+ 16/299
+ 55/299
+ 27/299
+ 7/299
+ 50/299
+ 31/299
+ 11/299
+ 83/248
+ 10/240
+ 1/240
+ 5/240
No
No
No
Yes
- 30
- 68
- 30
- 33
- 59
- 84
+ 45/299
+ 80/299
+ 43/299
- 1
- 25
+ 80/242
- 19
Yes
- 40
- 6
- 52
- 22
- 75
+ 40/241
+ 4/240
+ 3/240
+ 1/240
+ 19/240
+ 22/240
+ 9/240
+ 2/240
Ye...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 26ms
memory: 3768kb

input:

1000 13
8 4901
? 16 42
? 66 89
? 67 91
? 6 10
? 1 63
? 2 10
? 44 65
? 22 45
? 2 29
? 27 47
? 18 32
? 11 64
? 17 30
11 12279
? 65 99
? 20 33
? 57 71
? 20 68
? 38 58
? 4 4
? 2 4
? 19 95
? 58 74
? 23 39
? 29 71
? 17 49
? 4 32
3 11014
? 9 37
? 15 61
? 3 34
? 5 78
? 24 54
? 26 34
? 18 23
? 4 20
? 26 36
?...

output:

Yes
- 42
- 89
- 91
+ 10/299
- 63
+ 10/299
+ 29/243
+ 24/240
+ 28/240
+ 21/240
+ 15/240
- 64
+ 14/240
Yes
- 99
- 33
+ 71/299
+ 68/299
+ 58/299
+ 4/299
+ 4/299
+ 95/299
+ 53/245
+ 17/240
+ 43/240
+ 33/240
+ 29/240
No
No
No
No
No
Yes
- 9
+ 76/299
- 18
+ 87/299
- 10
- 12
- 3
+ 65/299
+ 89/299
- 25
+ 67/...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 27ms
memory: 3888kb

input:

1000 13
5 2258
? 89 96
? 6 46
? 8 75
? 18 66
? 1 3
? 35 96
? 60 88
? 4 68
? 12 51
? 84 95
? 7 46
? 9 21
? 52 52
11 12149
? 27 29
? 11 32
? 61 76
? 89 94
? 26 96
? 80 97
? 89 89
? 25 84
? 20 90
? 51 57
? 60 89
? 18 35
? 3 28
8 10339
? 81 92
? 32 72
? 54 73
? 3 9
? 29 35
? 24 25
? 70 72
? 23 36
? 4 16...

output:

Yes
+ 28/258
- 46
- 75
- 66
+ 3/240
- 96
- 88
- 68
- 51
+ 12/240
- 46
+ 13/240
+ 1/240
Yes
- 29
- 32
+ 76/299
+ 94/299
+ 79/251
+ 18/240
+ 1/240
+ 60/240
+ 71/240
+ 7/240
+ 30/240
+ 18/240
+ 26/240
Yes
+ 92/299
+ 72/299
+ 73/299
- 9
- 35
- 25
+ 72/299
+ 36/299
+ 16/299
+ 27/245
- 7
- 1
+ 23/240
Yes
...

result:

ok ok (1000 test cases)

Test #12:

score: 0
Accepted
time: 30ms
memory: 3904kb

input:

1000 13
6 11102
? 16 53
? 83 100
? 52 62
? 10 25
? 23 46
? 59 86
? 1 3
? 78 90
? 23 62
? 11 40
? 51 55
? 19 78
? 52 73
11 19315
? 48 48
? 14 23
? 13 89
? 2 28
? 27 29
? 97 98
? 30 70
? 77 80
? 67 97
? 10 83
? 4 11
? 4 28
? 1 24
10 16960
? 41 47
? 9 80
? 2 8
? 26 32
? 1 20
? 24 24
? 10 17
? 37 63
? 3...

output:

Yes
- 53
+ 100/299
- 62
- 25
- 46
+ 86/299
- 3
+ 90/299
- 62
- 40
+ 55/299
+ 78/299
+ 65/247
No
No
Yes
- 62
- 20
- 66
- 26
- 45
- 57
+ 36/299
+ 33/299
+ 60/299
+ 16/290
+ 68/240
+ 57/240
+ 78/240
No
Yes
- 70
- 78
- 88
- 70
- 30
- 35
- 40
+ 8/295
+ 24/240
+ 4/240
+ 57/240
+ 7/240
+ 1/240
No
No
Yes
- ...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 23ms
memory: 3908kb

input:

1000 13
6 2161
? 11 17
? 5 36
? 88 95
? 31 44
? 59 85
? 7 18
? 35 88
? 4 8
? 2 89
? 20 30
? 58 88
? 14 40
? 22 30
7 3123
? 19 30
? 15 19
? 84 90
? 65 84
? 59 71
? 9 54
? 2 92
? 2 9
? 21 42
? 15 44
? 17 33
? 32 99
? 19 19
7 3439
? 51 72
? 24 37
? 19 36
? 60 91
? 57 61
? 5 23
? 25 76
? 41 95
? 9 24
? ...

output:

No
Yes
- 30
+ 11/243
+ 7/240
- 84
+ 13/240
- 54
- 92
+ 8/240
+ 22/240
- 44
+ 17/240
- 99
+ 1/240
Yes
- 72
- 37
- 36
- 91
+ 22/259
+ 19/240
- 76
- 95
+ 16/240
+ 4/240
+ 12/240
+ 15/240
+ 6/240
Yes
- 59
- 2
- 64
- 11
+ 17/248
+ 3/240
- 58
+ 4/240
+ 1/240
- 95
+ 8/240
- 80
+ 7/240
No
No
No
Yes
- 1
- 78...

result:

ok ok (1000 test cases)

Test #14:

score: 0
Accepted
time: 28ms
memory: 3812kb

input:

1000 13
6 2111
? 8 61
? 1 14
? 36 64
? 3 32
? 16 63
? 19 62
? 19 21
? 14 17
? 3 52
? 33 83
? 51 66
? 13 23
? 12 43
7 2808
? 5 8
? 21 85
? 10 22
? 23 84
? 17 50
? 24 61
? 3 6
? 4 63
? 7 30
? 25 76
? 18 92
? 23 39
? 19 39
6 1989
? 91 93
? 28 41
? 17 53
? 66 73
? 7 26
? 35 50
? 2 2
? 3 86
? 29 32
? 10 ...

output:

No
No
Yes
+ 4/249
- 41
- 53
+ 8/240
- 26
- 50
+ 1/240
- 86
+ 4/240
- 44
+ 14/240
+ 2/240
- 68
Yes
- 19
- 48
- 83
+ 13/240
+ 35/240
+ 1/240
+ 1/240
- 71
- 82
+ 1/240
+ 5/240
+ 32/240
- 86
No
No
Yes
- 29
- 61
- 31
- 89
- 87
- 80
+ 3/266
+ 11/240
+ 5/240
- 69
+ 18/240
+ 13/240
+ 33/240
No
No
No
No
No
N...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 28ms
memory: 3908kb

input:

1000 13
6 11435
? 11 17
? 5 36
? 88 95
? 31 44
? 59 85
? 7 18
? 35 88
? 4 8
? 2 89
? 20 30
? 58 88
? 14 40
? 22 30
7 12636
? 19 30
? 15 19
? 84 90
? 65 84
? 59 71
? 9 54
? 2 92
? 2 9
? 21 42
? 15 44
? 17 33
? 32 99
? 19 19
7 12572
? 51 72
? 24 37
? 19 36
? 60 91
? 57 61
? 5 23
? 25 76
? 41 95
? 9 24...

output:

Yes
- 17
- 36
+ 95/299
+ 44/299
+ 85/299
- 18
+ 88/299
- 8
+ 89/299
- 30
+ 88/280
- 40
- 30
No
Yes
+ 72/299
- 37
- 36
+ 91/299
+ 61/299
- 23
+ 76/299
+ 95/299
- 24
- 9
+ 39/299
+ 97/298
- 12
No
No
No
No
No
Yes
+ 87/299
- 11
+ 53/299
+ 70/299
+ 34/299
- 23
+ 66/299
- 27
- 25
+ 89/299
+ 36/296
- 22
- ...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 32ms
memory: 3900kb

input:

1000 13
6 9645
? 8 61
? 1 14
? 36 64
? 3 32
? 16 63
? 19 62
? 19 21
? 14 17
? 3 52
? 33 83
? 51 66
? 13 23
? 12 43
7 12161
? 5 8
? 21 85
? 10 22
? 23 84
? 17 50
? 24 61
? 3 6
? 4 63
? 7 30
? 25 76
? 18 92
? 23 39
? 19 39
6 10123
? 91 93
? 28 41
? 17 53
? 66 73
? 7 26
? 35 50
? 2 2
? 3 86
? 29 32
? 1...

output:

Yes
+ 61/299
- 14
+ 64/299
- 32
+ 63/299
+ 62/299
- 21
- 17
- 52
+ 83/299
+ 66/290
- 23
- 43
Yes
- 8
+ 85/299
- 22
+ 84/299
+ 50/299
+ 61/299
- 6
+ 63/299
- 30
+ 76/299
+ 92/287
- 39
- 39
Yes
+ 93/299
- 41
+ 53/299
+ 73/299
- 26
+ 50/299
- 2
+ 86/299
- 32
- 44
- 22
- 5
+ 68/288
No
No
Yes
+ 61/299
+ ...

result:

ok ok (1000 test cases)

Test #17:

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

input:

21 13
13 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
12 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
13 1
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
12 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/...

output:

Yes
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
No
No
Yes
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
- 1
No
Yes
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
No
Yes
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
Y...

result:

ok ok (21 test cases)