QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#322809#2006. Parrotsbachbeo2007100 ✓2ms4120kbC++231.8kb2024-02-07 19:34:582024-02-07 19:34:58

Judging History

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

  • [2024-02-07 19:34:58]
  • 评测
  • 测评结果:100
  • 用时:2ms
  • 内存:4120kb
  • [2024-02-07 19:34:58]
  • 提交

encoder

#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define fi first
#define se second
const int maxa = 256;
const int Max = 35;
const int Lim = 27;
ll dp[55][55];


void encode(int N, int M[])
{
    for(int i=0;i<=Max;i++){
        for(int j=0;j<Lim;j++){
            dp[i][j]=!(i|j);
            if(i) dp[i][j]+=dp[i-1][j];
            if(j) dp[i][j]+=dp[i][j-1];
        }
    }
    int cur=0;
    for(int i=0;i<N;i+=7){
        ll num=0,mul=1;
        int cnt=0;
        for(int j=i;j<min(i+7,N);j++){
            num+=1LL*M[j]*mul,mul*=maxa,cnt++;
        }
        for(int j=cnt*5;j>=1;j--){
            for(int k=0;k<min(maxa-cur,Lim);k++){
                if(dp[j][k]>num){
                    if(k) num-=dp[j][k-1];
                    send(cur+k);
                    break;
                }
            }
        }
        cur+=Lim;
    }
}

decoder

#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxa = 256;
const int Max = 35;
const int Lim = 27;
ll dp[55][55];

void decode(int N, int L, int X[])
{
    for(int i=0;i<=Max;i++){
        for(int j=0;j<Lim;j++){
            dp[i][j]=!(i|j);
            if(i) dp[i][j]+=dp[i-1][j];
            if(j) dp[i][j]+=dp[i][j-1];
        }
    }
    vector<vector<int>> d(N);
    for(int i=0;i<L;i++) d[X[i]/Lim].push_back(X[i]%Lim);
    for(int i=0;i<N;i++){
        if(d[i].empty()) continue;
        sort(d[i].begin(),d[i].end());
        ll num=0;
        for(int j=(int)d[i].size();j>=1;j--){
            int k=d[i][j-1];
            if(k) num+=dp[j][k-1];
        }
        for(int j=i*7;j<min((i+1)*7,N);j++){
            output(num%maxa);
            num/=maxa;
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 1ms
memory: 4120kb

input:

10
8 40
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 27 27 27 27 27 
8 40
28 27 27 27 27 20 19 19 19 18 18 18 18 17 17 15 15 15 14 11 10 9 9 8 7 7 6 6 6 6 6 6 5 5 4 2 1 1 0 0 
8 40
1 1 2 2 2 3 5 6 6 6 6 6 8 8 10 11 11 11 11 12 13 13 14 15 15 17 17 18 18 18 18 19 19 19 20 27 ...

output:

0 0 0 0 0 0 0 0 
1 1 1 1 1 1 1 1 
0 1 0 1 0 1 1 0 
0 1 0 1 0 1 1 0 
0 1 0 1 0 1 1 0 
1 0 0 1 0 1 1 0 
1 0 0 1 1 1 1 0 
1 0 0 1 1 1 1 0 
1 1 0 1 0 0 0 0 
1 1 0 1 0 0 0 0 

input:


output:

5.000000

result:

ok 

Subtask #2:

score: 17
Accepted

Test #2:

score: 17
Accepted
time: 1ms
memory: 3828kb

input:

50
8 40
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 27 27 27 27 27 
8 40
33 28 28 28 27 26 25 24 24 24 24 24 24 21 21 20 19 17 17 17 17 15 15 13 13 13 12 12 12 12 12 8 7 5 3 2 2 1 1 1 
8 40
1 1 1 2 2 3 5 7 8 12 12 12 12 12 13 13 13 15 15 17 17 17 17 19 20 21 21 24 24 24 24 ...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
243 109 222 210 112 222 171 178 
228 158 233 59 205 124 41 237 
155 180 90 45 173 60 66 172 
164 37 205 149 192 176 235 103 
95 7 200 68 93 112 112 236 
232 187 132 122 197 218 57 94 
245 69 229 217 2...

input:


output:

5.000000

result:

ok 

Test #3:

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

input:

50
11 55
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 
11 55
43 42 41 39 35 35 34 34 32 32 32 32 32 32 32 32 30 30 27 27 26 25 24 24 24 24 24 24 21 21 20 19 17 17 17 17 15 15 13 13 13 12 12 12 12 12 8 7 5 3 2 2 1 1 ...

output:

0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 
223 48 201 197 29 95 155 229 169 194 210 
82 128 14 63 9 120 170 54 242 202 80 
185 205 138 0 95 1 39 84 220 84 151 
181 154 208 54 30 17 25 13 215 50 209 
92 134 8...

input:


output:

5.000000

result:

ok 

Test #4:

score: 17
Accepted
time: 1ms
memory: 4116kb

input:

50
15 75
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 
15 75
60 55 55 55 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 42 42 40 40 40 39 39 39 39 39 3...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
224 32 223 221 238 25 224 254 248 66 164 36 102 46 7 
33 26 6 162 138 31 204 225 175 131 134 45 51 142 6 
178 231 12...

input:


output:

5.000000

result:

ok 

Test #5:

score: 17
Accepted
time: 0ms
memory: 3844kb

input:

50
16 80
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 
16 80
63 62 62 62 60 56 55 55 54 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 4...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
26 106 184 90 58 147 93 85 1 116 9 221 62 228 113 188 
51 58 213 192 113 132 214 231 184 129 103 227 111...

input:


output:

5.000000

result:

ok 

Subtask #3:

score: 18
Accepted

Test #6:

score: 18
Accepted
time: 1ms
memory: 4092kb

input:

50
8 40
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 27 27 27 27 27 
8 40
33 28 28 28 27 26 25 24 24 24 24 24 24 21 21 20 19 17 17 17 17 15 15 13 13 13 12 12 12 12 12 8 7 5 3 2 2 1 1 1 
8 40
1 1 1 2 2 3 5 7 8 12 12 12 12 12 13 13 13 15 15 17 17 17 17 19 20 21 21 24 24 24 24 ...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
243 109 222 210 112 222 171 178 
228 158 233 59 205 124 41 237 
155 180 90 45 173 60 66 172 
164 37 205 149 192 176 235 103 
95 7 200 68 93 112 112 236 
232 187 132 122 197 218 57 94 
245 69 229 217 2...

input:


output:

5.000000

result:

ok 

Test #7:

score: 18
Accepted
time: 1ms
memory: 3892kb

input:

50
11 55
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 
11 55
43 42 41 39 35 35 34 34 32 32 32 32 32 32 32 32 30 30 27 27 26 25 24 24 24 24 24 24 21 21 20 19 17 17 17 17 15 15 13 13 13 12 12 12 12 12 8 7 5 3 2 2 1 1 ...

output:

0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 
223 48 201 197 29 95 155 229 169 194 210 
82 128 14 63 9 120 170 54 242 202 80 
185 205 138 0 95 1 39 84 220 84 151 
181 154 208 54 30 17 25 13 215 50 209 
92 134 8...

input:


output:

5.000000

result:

ok 

Test #8:

score: 18
Accepted
time: 1ms
memory: 3784kb

input:

50
15 75
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 
15 75
60 55 55 55 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 42 42 40 40 40 39 39 39 39 39 3...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
224 32 223 221 238 25 224 254 248 66 164 36 102 46 7 
33 26 6 162 138 31 204 225 175 131 134 45 51 142 6 
178 231 12...

input:


output:

5.000000

result:

ok 

Test #9:

score: 18
Accepted
time: 0ms
memory: 3800kb

input:

50
16 80
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 
16 80
63 62 62 62 60 56 55 55 54 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 4...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
26 106 184 90 58 147 93 85 1 116 9 221 62 228 113 188 
51 58 213 192 113 132 214 231 184 129 103 227 111...

input:


output:

5.000000

result:

ok 

Subtask #4:

score: 29
Accepted

Test #10:

score: 29
Accepted
time: 1ms
memory: 3780kb

input:

50
8 40
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 27 27 27 27 27 
8 40
33 28 28 28 27 26 25 24 24 24 24 24 24 21 21 20 19 17 17 17 17 15 15 13 13 13 12 12 12 12 12 8 7 5 3 2 2 1 1 1 
8 40
1 1 1 2 2 3 5 7 8 12 12 12 12 12 13 13 13 15 15 17 17 17 17 19 20 21 21 24 24 24 24 ...

output:

0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 
105 171 236 216 29 23 237 137 
133 238 133 208 208 161 99 228 
114 68 124 64 83 0 156 229 
107 234 136 136 175 106 239 229 
132 178 196 164 41 224 188...

input:


output:

5.000000

result:

ok 

Test #11:

score: 29
Accepted
time: 1ms
memory: 3896kb

input:

50
16 80
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 
16 80
63 62 62 62 60 56 55 55 54 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 4...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
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 
188 66...

input:


output:

5.000000

result:

ok 

Test #12:

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

input:

50
20 100
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 
20 100
77 73 73 73 73 73...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
0 0 0 0 0 0 0 0 ...

input:


output:

5.000000

result:

ok 

Test #13:

score: 29
Accepted
time: 2ms
memory: 4100kb

input:

50
30 150
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

5.000000

result:

ok 

Test #14:

score: 29
Accepted
time: 2ms
memory: 3840kb

input:

50
31 155
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ...

input:


output:

5.000000

result:

ok 

Test #15:

score: 29
Accepted
time: 0ms
memory: 3836kb

input:

50
32 160
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

5.000000

result:

ok 

Subtask #5:

score: 19
Accepted

Test #16:

score: 19
Accepted
time: 1ms
memory: 4100kb

input:

50
16 80
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 
16 80
63 62 62 62 60 56 55 55 54 54 53 52 51 51 51 51 51 51 48 48 47 46 44 44 44 44 4...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
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 
214 69...

input:


output:

5.000000

result:

points 1.0

Test #17:

score: 19
Accepted
time: 1ms
memory: 3844kb

input:

50
32 160
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 25...

input:


output:

5.000000

result:

points 1.0

Test #18:

score: 19
Accepted
time: 1ms
memory: 3836kb

input:

50
33 165
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ...

input:


output:

5.000000

result:

points 1.0

Test #19:

score: 19
Accepted
time: 2ms
memory: 3820kb

input:

50
50 250
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

5.000000

result:

points 1.0

Test #20:

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

input:

50
60 300
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

5.000000

result:

points 1.0

Test #21:

score: 19
Accepted
time: 2ms
memory: 3840kb

input:

50
63 315
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 2...

input:


output:

5.000000

result:

points 1.0

Test #22:

score: 19
Accepted
time: 2ms
memory: 3876kb

input:

50
64 320
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 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 81 81 81 8...

output:

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 
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255...

input:


output:

5.000000

result:

points 1.0