QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#173823#7178. Bishopsucup-team180#AC ✓18ms9320kbC++237.1kb2023-09-10 02:08:502023-09-10 02:08:51

Judging History

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

  • [2023-09-10 02:08:51]
  • 评测
  • 测评结果:AC
  • 用时:18ms
  • 内存:9320kb
  • [2023-09-10 02:08:50]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using ull = unsigned long long;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
template<class T> using pqmin = priority_queue<T, vector<T>, greater<T>>;
template<class T> using pqmax = priority_queue<T>;
const ll inf=LLONG_MAX/3;
const ll dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const ll dy[] = {1, 0, -1, 0, 1, 1, -1, -1};
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define si(x) ll(x.size())
#define rep(i,n) for(ll i=0;i<n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define rng(i,l,r) for(ll i=l;i<r;i++)
#define gnr(i,l,r) for(ll i=r-1;i>=l;i--)
#define fore(i, a) for(auto &&i : a)
#define fore2(a, b, v) for(auto &&[a, b] : v)
#define fore3(a, b, c, v) for(auto &&[a, b, c] : v)
template<class T> bool chmin(T& a, const T& b){ if(a <= b) return 0; a = b; return 1; }
template<class T> bool chmax(T& a, const T& b){ if(a >= b) return 0; a = b; return 1; }
template<class T, class U> bool chmin(T& a, const U& b){ return chmin(a, (T)b); }
template<class T, class U> bool chmax(T& a, const U& b){ return chmax(a, (T)b); }
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;in(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;in(__VA_ARGS__)
#define vec(type,name,...) vector<type>name(__VA_ARGS__)
#define VEC(type,name,size) vector<type>name(size);in(name)
#define VLL(name,size) vector<ll>name(size);in(name)
#define vv(type,name,h,...) vector<vector<type>> name(h,vector<type>(__VA_ARGS__))
#define VV(type,name,h,w) vector<vector<type>> name(h,vector<type>(w));in(name)
#define vvv(type,name,h,w,...) vector<vector<vector<type>>> name(h,vector<vector<type>>(w,vector<type>(__VA_ARGS__)))
#define SUM(...) accumulate(all(__VA_ARGS__),0LL)
template<class T> auto min(const T& a){ return *min_element(all(a)); }
template<class T> auto max(const T& a){ return *max_element(all(a)); }
template<class T, class F = less<>> void sor(T& a, F b = F{}){ sort(all(a), b); }
template<class T> void uniq(T& a){ sor(a); a.erase(unique(all(a)), end(a)); }
void outb(bool x){cout<<(x?"Yes":"No")<<"\n";}
ll max(int x, ll y) { return max((ll)x, y); }
ll max(ll x, int y) { return max(x, (ll)y); }
int min(int x, ll y) { return min((ll)x, y); }
int min(ll x, int y) { return min(x, (ll)y); }
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define lbg(c, x) distance((c).begin(), lower_bound(all(c), (x), greater{}))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define ubg(c, x) distance((c).begin(), upper_bound(all(c), (x), greater{}))
ll gcd(ll a,ll b){return (b?gcd(b,a%b):a);}
vector<pll> factor(ull x){ vector<pll> ans; for(ull i = 2; i * i <= x; i++) if(x % i == 0){ ans.push_back({i, 1}); while((x /= i) % i == 0) ans.back().second++; } if(x != 1) ans.push_back({x, 1}); return ans; }
vector<ll> divisor(ull x){ vector<ll> ans; for(ull i = 1; i * i <= x; i++) if(x % i == 0) ans.push_back(i); per(i,ans.size() - (ans.back() * ans.back() == x)) ans.push_back(x / ans[i]); return ans; }
vll prime_table(ll n){vec(ll,isp,n+1,1);vll res;rng(i,2,n+1)if(isp[i]){res.pb(i);for(ll j=i*i;j<=n;j+=i)isp[j]=0;}return res;}

template <class T, class S> pair<T, S> operator-(const pair<T, S> &x) { return pair<T, S>(-x.first, -x.second); }
template <class T, class S> pair<T, S> operator-(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi - y.fi, x.se - y.se); }
template <class T, class S> pair<T, S> operator+(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi + y.fi, x.se + y.se); }
template <class T> pair<T, T> operator&(const pair<T, T> &l, const pair<T, T> &r) { return pair<T, T>(max(l.fi, r.fi), min(l.se, r.se)); }
template <class T, class S> pair<T, S> operator+=(pair<T, S> &l, const pair<T, S> &r) { return l = l + r; }
template <class T, class S> pair<T, S> operator-=(pair<T, S> &l, const pair<T, S> &r) { return l = l - r; }
template <class T> bool intersect(const pair<T, T> &l, const pair<T, T> &r) { return (l.se < r.se ? r.fi < l.se : l.fi < r.se); }

template <class T> vector<T> &operator++(vector<T> &v) {
		fore(e, v) e++;
		return v;
}
template <class T> vector<T> operator++(vector<T> &v, int) {
		auto res = v;
		fore(e, v) e++;
		return res;
}
template <class T> vector<T> &operator--(vector<T> &v) {
		fore(e, v) e--;
		return v;
}
template <class T> vector<T> operator--(vector<T> &v, int) {
		auto res = v;
		fore(e, v) e--;
		return res;
}
template <class T> vector<T> &operator+=(vector<T> &l, const vector<T> &r) {
		fore(e, r) l.eb(e);
		return l;
}

template<class... Ts> void in(Ts&... t);
[[maybe_unused]] void print(){}
template<class T, class... Ts> void print(const T& t, const Ts&... ts);
template<class... Ts> void out(const Ts&... ts){ print(ts...); cout << '\n'; }
namespace IO{
#define VOID(a) decltype(void(a))
struct S{ S(){ cin.tie(nullptr)->sync_with_stdio(0); fixed(cout).precision(12); } }S;
template<int I> struct P : P<I-1>{};
template<> struct P<0>{};
template<class T> void i(T& t){ i(t, P<3>{}); }
void i(vector<bool>::reference t, P<3>){ int a; i(a); t = a; }
template<class T> auto i(T& t, P<2>) -> VOID(cin >> t){ cin >> t; }
template<class T> auto i(T& t, P<1>) -> VOID(begin(t)){ for(auto&& x : t) i(x); }
template<class T, size_t... idx> void ituple(T& t, index_sequence<idx...>){ in(get<idx>(t)...); }
template<class T> auto i(T& t, P<0>) -> VOID(tuple_size<T>{}){ ituple(t, make_index_sequence<tuple_size<T>::value>{}); }
template<class T> void o(const T& t){ o(t, P<4>{}); }
template<size_t N> void o(const char (&t)[N], P<4>){ cout << t; }
template<class T, size_t N> void o(const T (&t)[N], P<3>){ o(t[0]); for(size_t i = 1; i < N; i++){ o(' '); o(t[i]); } }
template<class T> auto o(const T& t, P<2>) -> VOID(cout << t){ cout << t; }
template<class T> auto o(const T& t, P<1>) -> VOID(begin(t)){ bool first = 1; for(auto&& x : t) { if(first) first = 0; else o(' '); o(x); } }
template<class T, size_t... idx> void otuple(const T& t, index_sequence<idx...>){ print(get<idx>(t)...); }
template<class T> auto o(T& t, P<0>) -> VOID(tuple_size<T>{}){ otuple(t, make_index_sequence<tuple_size<T>::value>{}); }
#undef VOID
}
#define unpack(a) (void)initializer_list<int>{(a, 0)...}
template<class... Ts> void in(Ts&... t){ unpack(IO::i(t)); }
template<class T, class... Ts> void print(const T& t, const Ts&... ts){ IO::o(t); unpack(IO::o((cout << ' ', ts))); }
#undef unpack
void solve(ll n,ll m,vpll &res){
	if(n==1&&m==1){
		res.eb(0,0);
		return;
	}
	if(n==m){
		rep(i,n-1){
			res.eb(i,0);
			res.eb(i,n-1);
		}
		return;
	}
	bool swapped=0;
	if(n>m){
		swapped=1;
		swap(n,m);
	}
	ll r=m%n;
	if(r==0)r=n;
	solve(n,r,res);
	if(n==r&&n%2==1&&n>1){
		res.eb(n-1+n/2,n/2);
	}
	rep(k,(m-r)/n){
		rep(i,n)res.eb(r+k*n+n-1,i);
	}
	if(swapped){
		swap(n,m);
		fore2(x,y,res)swap(x,y);
	}
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	LL(n,m);
	vpll ans;
	solve(n,m,ans);
	out(si(ans));
	fore2(x,y,ans){
		cout<<y+1<<" "<<x+1<<"\n";
	}
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 5

output:

6
1 1
2 1
1 3
2 3
1 5
2 5

result:

ok n: 2, m: 5, bishops: 6

Test #2:

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

input:

5 5

output:

8
1 1
5 1
1 2
5 2
1 3
5 3
1 4
5 4

result:

ok n: 5, m: 5, bishops: 8

Test #3:

score: 0
Accepted
time: 14ms
memory: 9320kb

input:

100000 100000

output:

199998
1 1
100000 1
1 2
100000 2
1 3
100000 3
1 4
100000 4
1 5
100000 5
1 6
100000 6
1 7
100000 7
1 8
100000 8
1 9
100000 9
1 10
100000 10
1 11
100000 11
1 12
100000 12
1 13
100000 13
1 14
100000 14
1 15
100000 15
1 16
100000 16
1 17
100000 17
1 18
100000 18
1 19
100000 19
1 20
100000 20
1 21
100000...

result:

ok n: 100000, m: 100000, bishops: 199998

Test #4:

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

input:

100000 99999

output:

199998
1 1
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 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 100000, m: 99999, bishops: 199998

Test #5:

score: 0
Accepted
time: 13ms
memory: 9232kb

input:

100000 50000

output:

149998
1 1
1 50000
2 1
2 50000
3 1
3 50000
4 1
4 50000
5 1
5 50000
6 1
6 50000
7 1
7 50000
8 1
8 50000
9 1
9 50000
10 1
10 50000
11 1
11 50000
12 1
12 50000
13 1
13 50000
14 1
14 50000
15 1
15 50000
16 1
16 50000
17 1
17 50000
18 1
18 50000
19 1
19 50000
20 1
20 50000
21 1
21 50000
22 1
22 50000
23 ...

result:

ok n: 100000, m: 50000, bishops: 149998

Test #6:

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

input:

1 100000

output:

100000
1 1
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 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 ...

result:

ok n: 1, m: 100000, bishops: 100000

Test #7:

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

input:

34535 99889

output:

134423
1 1
1 2
3 1
3 2
5 1
5 2
1 7
2 7
3 7
4 7
5 7
12 1
12 2
12 3
12 4
12 5
12 6
12 7
19 1
19 2
19 3
19 4
19 5
19 6
19 7
26 1
26 2
26 3
26 4
26 5
26 6
26 7
33 1
33 2
33 3
33 4
33 5
33 6
33 7
1 40
2 40
3 40
4 40
5 40
6 40
7 40
8 40
9 40
10 40
11 40
12 40
13 40
14 40
15 40
16 40
17 40
18 40
19 40
20 4...

result:

ok n: 34535, m: 99889, bishops: 134423

Test #8:

score: 0
Accepted
time: 13ms
memory: 5352kb

input:

12231 97889

output:

110119
1 1
1 2
3 1
3 2
5 1
5 2
7 1
7 2
9 1
9 2
11 1
11 2
13 1
13 2
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1 28
2 28
3 28
4 28
5 28
6 28
7 28
8 28
9 28
10 28
11 28
12 28
13 28
1 41
2 41
3 41
4 41
5 41
6 41
7 41
8 41
9 41
10 41
11 41
12 41
13 41
54 1
54 2
54 3
54 4
54 5
5...

result:

ok n: 12231, m: 97889, bishops: 110119

Test #9:

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

input:

10000 100000

output:

109998
1 1
10000 1
1 2
10000 2
1 3
10000 3
1 4
10000 4
1 5
10000 5
1 6
10000 6
1 7
10000 7
1 8
10000 8
1 9
10000 9
1 10
10000 10
1 11
10000 11
1 12
10000 12
1 13
10000 13
1 14
10000 14
1 15
10000 15
1 16
10000 16
1 17
10000 17
1 18
10000 18
1 19
10000 19
1 20
10000 20
1 21
10000 21
1 22
10000 22
1 2...

result:

ok n: 10000, m: 100000, bishops: 109998

Test #10:

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

input:

13 99999

output:

100011
1 1
1 2
1 3
4 1
4 2
4 3
7 1
7 2
7 3
10 1
10 2
10 3
13 1
13 2
13 3
1 16
2 16
3 16
4 16
5 16
6 16
7 16
8 16
9 16
10 16
11 16
12 16
13 16
1 29
2 29
3 29
4 29
5 29
6 29
7 29
8 29
9 29
10 29
11 29
12 29
13 29
1 42
2 42
3 42
4 42
5 42
6 42
7 42
8 42
9 42
10 42
11 42
12 42
13 42
1 55
2 55
3 55
4 55
...

result:

ok n: 13, m: 99999, bishops: 100011

Test #11:

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

input:

21 99999

output:

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

result:

ok n: 21, m: 99999, bishops: 100019

Test #12:

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

input:

49999 100000

output:

149998
1 1
1 2
3 1
3 2
5 1
5 2
7 1
7 2
9 1
9 2
11 1
11 2
13 1
13 2
15 1
15 2
17 1
17 2
19 1
19 2
21 1
21 2
23 1
23 2
25 1
25 2
27 1
27 2
29 1
29 2
31 1
31 2
33 1
33 2
35 1
35 2
37 1
37 2
39 1
39 2
41 1
41 2
43 1
43 2
45 1
45 2
47 1
47 2
49 1
49 2
51 1
51 2
53 1
53 2
55 1
55 2
57 1
57 2
59 1
59 2
61 ...

result:

ok n: 49999, m: 100000, bishops: 149998

Test #13:

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

input:

33333 99999

output:

133331
1 1
33333 1
1 2
33333 2
1 3
33333 3
1 4
33333 4
1 5
33333 5
1 6
33333 6
1 7
33333 7
1 8
33333 8
1 9
33333 9
1 10
33333 10
1 11
33333 11
1 12
33333 12
1 13
33333 13
1 14
33333 14
1 15
33333 15
1 16
33333 16
1 17
33333 17
1 18
33333 18
1 19
33333 19
1 20
33333 20
1 21
33333 21
1 22
33333 22
1 2...

result:

ok n: 33333, m: 99999, bishops: 133331

Test #14:

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

input:

23342 98876

output:

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

result:

ok n: 23342, m: 98876, bishops: 122216

Test #15:

score: 0
Accepted
time: 14ms
memory: 8176kb

input:

56713 91234

output:

147946
1 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
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61...

result:

ok n: 56713, m: 91234, bishops: 147946

Test #16:

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

input:

99995 99995

output:

199988
1 1
99995 1
1 2
99995 2
1 3
99995 3
1 4
99995 4
1 5
99995 5
1 6
99995 6
1 7
99995 7
1 8
99995 8
1 9
99995 9
1 10
99995 10
1 11
99995 11
1 12
99995 12
1 13
99995 13
1 14
99995 14
1 15
99995 15
1 16
99995 16
1 17
99995 17
1 18
99995 18
1 19
99995 19
1 20
99995 20
1 21
99995 21
1 22
99995 22
1 2...

result:

ok n: 99995, m: 99995, bishops: 199988

Test #17:

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

input:

12345 54321

output:

66665
1 1
3 1
1 2
3 2
2 4
1 6
2 6
3 6
1 9
2 9
3 9
1 12
2 12
3 12
1 15
2 15
3 15
18 1
18 2
18 3
18 4
18 5
18 6
18 7
18 8
18 9
18 10
18 11
18 12
18 13
18 14
18 15
33 1
33 2
33 3
33 4
33 5
33 6
33 7
33 8
33 9
33 10
33 11
33 12
33 13
33 14
33 15
48 1
48 2
48 3
48 4
48 5
48 6
48 7
48 8
48 9
48 10
48 11
4...

result:

ok n: 12345, m: 54321, bishops: 66665

Test #18:

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

input:

90000 92000

output:

181998
1 1
1 2000
2 1
2 2000
3 1
3 2000
4 1
4 2000
5 1
5 2000
6 1
6 2000
7 1
7 2000
8 1
8 2000
9 1
9 2000
10 1
10 2000
11 1
11 2000
12 1
12 2000
13 1
13 2000
14 1
14 2000
15 1
15 2000
16 1
16 2000
17 1
17 2000
18 1
18 2000
19 1
19 2000
20 1
20 2000
21 1
21 2000
22 1
22 2000
23 1
23 2000
24 1
24 2000...

result:

ok n: 90000, m: 92000, bishops: 181998

Test #19:

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

input:

10000 70000

output:

79998
1 1
10000 1
1 2
10000 2
1 3
10000 3
1 4
10000 4
1 5
10000 5
1 6
10000 6
1 7
10000 7
1 8
10000 8
1 9
10000 9
1 10
10000 10
1 11
10000 11
1 12
10000 12
1 13
10000 13
1 14
10000 14
1 15
10000 15
1 16
10000 16
1 17
10000 17
1 18
10000 18
1 19
10000 19
1 20
10000 20
1 21
10000 21
1 22
10000 22
1 23...

result:

ok n: 10000, m: 70000, bishops: 79998

Test #20:

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

input:

10000 70001

output:

80000
1 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
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 ...

result:

ok n: 10000, m: 70001, bishops: 80000

Test #21:

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

input:

10000 80000

output:

89998
1 1
10000 1
1 2
10000 2
1 3
10000 3
1 4
10000 4
1 5
10000 5
1 6
10000 6
1 7
10000 7
1 8
10000 8
1 9
10000 9
1 10
10000 10
1 11
10000 11
1 12
10000 12
1 13
10000 13
1 14
10000 14
1 15
10000 15
1 16
10000 16
1 17
10000 17
1 18
10000 18
1 19
10000 19
1 20
10000 20
1 21
10000 21
1 22
10000 22
1 23...

result:

ok n: 10000, m: 80000, bishops: 89998

Test #22:

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

input:

10000 80001

output:

90000
1 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
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 ...

result:

ok n: 10000, m: 80001, bishops: 90000

Test #23:

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

input:

10000 80002

output:

90000
1 1
1 2
4 1
4 2
6 1
6 2
8 1
8 2
10 1
10 2
12 1
12 2
14 1
14 2
16 1
16 2
18 1
18 2
20 1
20 2
22 1
22 2
24 1
24 2
26 1
26 2
28 1
28 2
30 1
30 2
32 1
32 2
34 1
34 2
36 1
36 2
38 1
38 2
40 1
40 2
42 1
42 2
44 1
44 2
46 1
46 2
48 1
48 2
50 1
50 2
52 1
52 2
54 1
54 2
56 1
56 2
58 1
58 2
60 1
60 2
62...

result:

ok n: 10000, m: 80002, bishops: 90000

Test #24:

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

input:

10000 79999

output:

89998
1 1
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 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44
1 45
1 46
1 47
1 48
1 49
1 50
1 51
1 52
1 53
1 54
1 55
1 56
1 57
1 58
1 59
1 60
1 6...

result:

ok n: 10000, m: 79999, bishops: 89998

Test #25:

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

input:

10000 79998

output:

89996
1 1
2 1
1 4
2 4
1 6
2 6
1 8
2 8
1 10
2 10
1 12
2 12
1 14
2 14
1 16
2 16
1 18
2 18
1 20
2 20
1 22
2 22
1 24
2 24
1 26
2 26
1 28
2 28
1 30
2 30
1 32
2 32
1 34
2 34
1 36
2 36
1 38
2 38
1 40
2 40
1 42
2 42
1 44
2 44
1 46
2 46
1 48
2 48
1 50
2 50
1 52
2 52
1 54
2 54
1 56
2 56
1 58
2 58
1 60
2 60
1 ...

result:

ok n: 10000, m: 79998, bishops: 89996

Test #26:

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

input:

11111 100000

output:

111110
1 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
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61...

result:

ok n: 11111, m: 100000, bishops: 111110

Test #27:

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

input:

1 1

output:

1
1 1

result:

ok n: 1, m: 1, bishops: 1

Extra Test:

score: 0
Extra Test Passed