QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#794780#9183. BouquetMousa_Aboubaker8 18ms5580kbC++201.6kb2024-11-30 16:03:212024-11-30 16:03:23

Judging History

This is the latest submission verdict.

  • [2024-11-30 16:03:23]
  • Judged
  • Verdict: 8
  • Time: 18ms
  • Memory: 5580kb
  • [2024-11-30 16:03:21]
  • Submitted

answer

#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <deque>
#include <climits>
#include <cmath>
#include <numeric>
#include <string>
#include <bitset>
#include <assert.h>
#include <iomanip>
using namespace std;
 
template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
 
const long long infl = 1e18 + 1;
const int inf = 1e9 + 1;
const int mod1 = 1e9 + 7;
const int mod2 = 998244353;
const long double eps = 1e-7;
const int mod = mod1;
 
int add(int a, int b) { return (a + b) % mod; }
int sub(int a, int b) { return (a - b + mod) % mod; }
int mul(int a, int b) { return (int)((long long)a * b % mod); }
int pwr(int a, int b = mod - 2)
{
	int res = 1;
	for(; b > 0; b >>= 1, a = mul(a, a))
		if(b & 1)
			res = mul(res, a);
	return res;
}
 
void solve()
{
	int n;
	cin >> n;
	vector<pair<int, int>> a(n);
	for(auto &[f, s]: a)
		cin >> f >> s;
	vector<int> dp(n, 1);
	for(int i = 0; i < n; i++)
		if(i > a[i].first)
			dp[i] += dp[i - a[i].first - 1];
	cout << *max_element(dp.begin(), dp.end());
}
 
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
 
	int t = 1;
	// cin >> t;
 
	while (t--) {
		solve();
		cout << (t ? "\n" : "");
	}
}


Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 8
Accepted

Test #1:

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

input:

1
0 0

output:

1

result:

ok single line: '1'

Test #2:

score: 8
Accepted
time: 12ms
memory: 5428kb

input:

200000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 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:

200000

result:

ok single line: '200000'

Test #3:

score: 8
Accepted
time: 10ms
memory: 5484kb

input:

200000
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28...

output:

6897

result:

ok single line: '6897'

Test #4:

score: 8
Accepted
time: 12ms
memory: 5408kb

input:

200000
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1...

output:

100000

result:

ok single line: '100000'

Test #5:

score: 8
Accepted
time: 10ms
memory: 5412kb

input:

200000
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60...

output:

3279

result:

ok single line: '3279'

Test #6:

score: 8
Accepted
time: 11ms
memory: 5444kb

input:

200000
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 1...

output:

1048

result:

ok single line: '1048'

Test #7:

score: 8
Accepted
time: 10ms
memory: 5496kb

input:

200000
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
269...

output:

75

result:

ok single line: '75'

Test #8:

score: 8
Accepted
time: 18ms
memory: 5444kb

input:

200000
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078...

output:

9

result:

ok single line: '9'

Test #9:

score: 8
Accepted
time: 18ms
memory: 5500kb

input:

200000
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517...

output:

3

result:

ok single line: '3'

Test #10:

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

input:

1000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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:

1000

result:

ok single line: '1000'

Test #11:

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

input:

1000
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4...

output:

200

result:

ok single line: '200'

Test #12:

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

input:

1000
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
4...

output:

22

result:

ok single line: '22'

Test #13:

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

input:

1000
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
3...

output:

29

result:

ok single line: '29'

Test #14:

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

input:

1000
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421...

output:

3

result:

ok single line: '3'

Test #15:

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

input:

6
2 2
2 2
2 2
2 2
2 2
2 2

output:

2

result:

ok single line: '2'

Subtask #2:

score: 0
Wrong Answer

Test #16:

score: 16
Accepted
time: 12ms
memory: 5360kb

input:

200000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 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:

200000

result:

ok single line: '200000'

Test #17:

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

input:

1000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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:

1000

result:

ok single line: '1000'

Test #18:

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

input:

1
1 0

output:

1

result:

ok single line: '1'

Test #19:

score: 16
Accepted
time: 6ms
memory: 5508kb

input:

200000
1 0
1 0
0 0
1 0
1 0
1 0
1 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 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
1 0
0 0
0 0
0 0
1 0
0 0
0 0
0...

output:

133350

result:

ok single line: '133350'

Test #20:

score: 0
Wrong Answer
time: 13ms
memory: 5424kb

input:

200000
2 0
2 0
2 0
0 0
0 0
1 0
2 0
1 0
2 0
1 0
2 0
1 0
2 0
2 0
2 0
0 0
2 0
2 0
0 0
2 0
1 0
0 0
0 0
0 0
2 0
2 0
2 0
2 0
0 0
0 0
0 0
2 0
2 0
1 0
1 0
2 0
1 0
1 0
2 0
2 0
0 0
0 0
1 0
1 0
1 0
1 0
2 0
2 0
2 0
2 0
2 0
0 0
1 0
2 0
2 0
0 0
0 0
2 0
1 0
1 0
2 0
1 0
0 0
2 0
0 0
1 0
2 0
1 0
2 0
2 0
1 0
2 0
2 0
2...

output:

100118

result:

wrong answer 1st lines differ - expected: '105974', found: '100118'

Subtask #3:

score: 0
Wrong Answer

Test #48:

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

input:

1000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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:

1000

result:

ok single line: '1000'

Test #49:

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

input:

1000
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4...

output:

200

result:

ok single line: '200'

Test #50:

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

input:

1000
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
4...

output:

22

result:

ok single line: '22'

Test #51:

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

input:

1000
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
3...

output:

29

result:

ok single line: '29'

Test #52:

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

input:

1000
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421...

output:

3

result:

ok single line: '3'

Test #53:

score: 0
Wrong Answer
time: 0ms
memory: 3640kb

input:

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

output:

275

result:

wrong answer 1st lines differ - expected: '361', found: '275'

Subtask #4:

score: 0
Wrong Answer

Test #127:

score: 18
Accepted
time: 12ms
memory: 5424kb

input:

200000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 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:

200000

result:

ok single line: '200000'

Test #128:

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

input:

1000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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:

1000

result:

ok single line: '1000'

Test #129:

score: 18
Accepted
time: 10ms
memory: 5428kb

input:

200000
1 0
1 0
0 0
1 0
1 0
1 0
1 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 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
1 0
0 0
0 0
0 0
1 0
0 0
0 0
0...

output:

133350

result:

ok single line: '133350'

Test #130:

score: 0
Wrong Answer
time: 13ms
memory: 5432kb

input:

200000
2 0
2 0
2 0
0 0
0 0
1 0
2 0
1 0
2 0
1 0
2 0
1 0
2 0
2 0
2 0
0 0
2 0
2 0
0 0
2 0
1 0
0 0
0 0
0 0
2 0
2 0
2 0
2 0
0 0
0 0
0 0
2 0
2 0
1 0
1 0
2 0
1 0
1 0
2 0
2 0
0 0
0 0
1 0
1 0
1 0
1 0
2 0
2 0
2 0
2 0
2 0
0 0
1 0
2 0
2 0
0 0
0 0
2 0
1 0
1 0
2 0
1 0
0 0
2 0
0 0
1 0
2 0
1 0
2 0
2 0
1 0
2 0
2 0
2...

output:

100118

result:

wrong answer 1st lines differ - expected: '105974', found: '100118'

Subtask #5:

score: 0
Wrong Answer

Test #155:

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

input:

1
0 0

output:

1

result:

ok single line: '1'

Test #156:

score: 30
Accepted
time: 12ms
memory: 5424kb

input:

200000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 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:

200000

result:

ok single line: '200000'

Test #157:

score: 30
Accepted
time: 13ms
memory: 5404kb

input:

200000
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28
28 28...

output:

6897

result:

ok single line: '6897'

Test #158:

score: 30
Accepted
time: 12ms
memory: 5576kb

input:

200000
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1...

output:

100000

result:

ok single line: '100000'

Test #159:

score: 30
Accepted
time: 7ms
memory: 5412kb

input:

200000
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60
60 60...

output:

3279

result:

ok single line: '3279'

Test #160:

score: 30
Accepted
time: 15ms
memory: 5552kb

input:

200000
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 190
190 1...

output:

1048

result:

ok single line: '1048'

Test #161:

score: 30
Accepted
time: 17ms
memory: 5556kb

input:

200000
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
2690 2690
269...

output:

75

result:

ok single line: '75'

Test #162:

score: 30
Accepted
time: 18ms
memory: 5404kb

input:

200000
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078 23078
23078...

output:

9

result:

ok single line: '9'

Test #163:

score: 30
Accepted
time: 14ms
memory: 5580kb

input:

200000
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517 97517
97517...

output:

3

result:

ok single line: '3'

Test #164:

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

input:

1000
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
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:

1000

result:

ok single line: '1000'

Test #165:

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

input:

1000
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4
4 4...

output:

200

result:

ok single line: '200'

Test #166:

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

input:

1000
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
46 46
4...

output:

22

result:

ok single line: '22'

Test #167:

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

input:

1000
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
34 34
3...

output:

29

result:

ok single line: '29'

Test #168:

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

input:

1000
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421
421 421...

output:

3

result:

ok single line: '3'

Test #169:

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

input:

1
1 0

output:

1

result:

ok single line: '1'

Test #170:

score: 30
Accepted
time: 10ms
memory: 5404kb

input:

200000
1 0
1 0
0 0
1 0
1 0
1 0
1 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
1 0
0 0
0 0
0 0
0 0
1 0
0 0
0 0
1 0
1 0
0 0
0 0
1 0
0 0
1 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
1 0
0 0
0 0
0 0
1 0
0 0
0 0
0...

output:

133350

result:

ok single line: '133350'

Test #171:

score: 0
Wrong Answer
time: 13ms
memory: 5408kb

input:

200000
2 0
2 0
2 0
0 0
0 0
1 0
2 0
1 0
2 0
1 0
2 0
1 0
2 0
2 0
2 0
0 0
2 0
2 0
0 0
2 0
1 0
0 0
0 0
0 0
2 0
2 0
2 0
2 0
0 0
0 0
0 0
2 0
2 0
1 0
1 0
2 0
1 0
1 0
2 0
2 0
0 0
0 0
1 0
1 0
1 0
1 0
2 0
2 0
2 0
2 0
2 0
0 0
1 0
2 0
2 0
0 0
0 0
2 0
1 0
1 0
2 0
1 0
0 0
2 0
0 0
1 0
2 0
1 0
2 0
2 0
1 0
2 0
2 0
2...

output:

100118

result:

wrong answer 1st lines differ - expected: '105974', found: '100118'