QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#177837#7227. The Magic SquareCrysfly#AC ✓1ms3632kbC++173.0kb2023-09-13 14:33:242023-09-13 14:33:24

Judging History

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

  • [2023-09-13 14:33:24]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3632kb
  • [2023-09-13 14:33:24]
  • 提交

answer

// what is matter? never mind. 
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
#define ull unsigned long long
#define int long long
using namespace std;
inline int read()
{
	char c=getchar();int x=0;bool f=0;
	for(;!isdigit(c);c=getchar())f^=!(c^45);
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	if(f)x=-x;return x;
}

#define mod 998244353
struct modint{
	int x;
	modint(int o=0){x=o;}
	modint &operator = (int o){return x=o,*this;}
	modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
	modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
	modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
	modint &operator ^=(int b){
		modint a=*this,c=1;
		for(;b;b>>=1,a*=a)if(b&1)c*=a;
		return x=c.x,*this;
	}
	modint &operator /=(modint o){return *this *=o^=mod-2;}
	friend modint operator +(modint a,modint b){return a+=b;}
	friend modint operator -(modint a,modint b){return a-=b;}
	friend modint operator *(modint a,modint b){return a*=b;}
	friend modint operator /(modint a,modint b){return a/=b;}
	friend modint operator ^(modint a,int b){return a^=b;}
	friend bool operator ==(modint a,int b){return a.x==b;}
	friend bool operator !=(modint a,int b){return a.x!=b;}
	bool operator ! () {return !x;}
	modint operator - () {return x?mod-x:0;}
	bool operator <(const modint&b)const{return x<b.x;}
};
inline modint qpow(modint x,int y){return x^y;}

vector<modint> fac,ifac,iv;
inline void initC(int n)
{
	if(iv.empty())fac=ifac=iv=vector<modint>(2,1);
	int m=iv.size(); ++n;
	if(m>=n)return;
	iv.resize(n),fac.resize(n),ifac.resize(n);
	For(i,m,n-1){
		iv[i]=iv[mod%i]*(mod-mod/i);
		fac[i]=fac[i-1]*i,ifac[i]=ifac[i-1]*iv[i];
	}
}
inline modint C(int n,int m){
	if(m<0||n<m)return 0;
	return initC(n),fac[n]*ifac[m]*ifac[n-m];
}
inline modint sign(int n){return (n&1)?(mod-1):(1);}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 10005
#define inf 0x3f3f3f3f

int n,m;
int a[1005][1005],cnt;

void check()
{
	bool ok=(m*m>=n && (m*m-n)%3==0);
	ok|=(m*m-8>=n && (m*m-n)%3==2);
	if(!ok)return;
	cnt=0;
	if((m*m-n)%3){
		cnt=1;
		For(i,1,3)For(j,1,3)a[i][j]=1;
	}
//	cerr<<"m: "<<m<<"\n";
	int qwq=(m*m-n)/3;
	if((m*m-n)%3) qwq-=2;
	For(i,1,m-1)
		For(j,1,m-1)
			if(!a[i][j]&&!a[i][j+1]&&!a[i+1][j]&&!a[i+1][j+1]&&qwq)
				a[i][j]=a[i][j+1]=a[i+1][j]=a[i+1][j+1]=++cnt,--qwq;
	For(i,1,m)For(j,1,m)if(!a[i][j])a[i][j]=++cnt;
	if(cnt!=n){
		puts("Impossible");
		exit(0);
	}
	puts("Possible");
	cout<<m<<"\n";
	For(i,1,m)For(j,1,m)cout<<a[i][j]<<" \n"[j==m];
	exit(0);
}
signed main()
{
	n=read();
	for(m=1; ;++m) check();
	return 0;
}
/*

*/

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2

output:

Impossible

result:

ok No solution for 2 squares

Test #2:

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

input:

4

output:

Possible
2
1 2
3 4

result:

ok answer 4 squares of 1 different sizes in total 2 * 2

Test #3:

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

input:

1

output:

Possible
1
1

result:

ok answer 1 squares of 1 different sizes in total 1 * 1

Test #4:

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

input:

3

output:

Impossible

result:

ok No solution for 3 squares

Test #5:

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

input:

5

output:

Impossible

result:

ok No solution for 5 squares

Test #6:

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

input:

6

output:

Possible
3
1 1 2
1 1 3
4 5 6

result:

ok answer 6 squares of 2 different sizes in total 3 * 3

Test #7:

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

input:

7

output:

Possible
4
1 1 2 2
1 1 2 2
3 3 4 5
3 3 6 7

result:

ok answer 7 squares of 2 different sizes in total 4 * 4

Test #8:

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

input:

8

output:

Possible
4
1 1 1 2
1 1 1 3
1 1 1 4
5 6 7 8

result:

ok answer 8 squares of 2 different sizes in total 4 * 4

Test #9:

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

input:

9

output:

Possible
3
1 2 3
4 5 6
7 8 9

result:

ok answer 9 squares of 1 different sizes in total 3 * 3

Test #10:

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

input:

10

output:

Possible
4
1 1 2 2
1 1 2 2
3 4 5 6
7 8 9 10

result:

ok answer 10 squares of 2 different sizes in total 4 * 4

Test #11:

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

input:

11

output:

Possible
5
1 1 1 2 2
1 1 1 2 2
1 1 1 3 3
4 5 6 3 3
7 8 9 10 11

result:

ok answer 11 squares of 3 different sizes in total 5 * 5

Test #12:

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

input:

12

output:

Possible
6
1 1 2 2 3 3
1 1 2 2 3 3
4 4 5 5 6 6
4 4 5 5 6 6
7 7 8 8 9 10
7 7 8 8 11 12

result:

ok answer 12 squares of 2 different sizes in total 6 * 6

Test #13:

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

input:

13

output:

Possible
4
1 1 2 3
1 1 4 5
6 7 8 9
10 11 12 13

result:

ok answer 13 squares of 2 different sizes in total 4 * 4

Test #14:

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

input:

14

output:

Possible
5
1 1 1 2 2
1 1 1 2 2
1 1 1 3 4
5 6 7 8 9
10 11 12 13 14

result:

ok answer 14 squares of 3 different sizes in total 5 * 5

Test #15:

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

input:

15

output:

Possible
6
1 1 2 2 3 3
1 1 2 2 3 3
4 4 5 5 6 6
4 4 5 5 6 6
7 7 8 9 10 11
7 7 12 13 14 15

result:

ok answer 15 squares of 2 different sizes in total 6 * 6

Test #16:

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

input:

16

output:

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

result:

ok answer 16 squares of 1 different sizes in total 4 * 4

Test #17:

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

input:

17

output:

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

result:

ok answer 17 squares of 2 different sizes in total 5 * 5

Test #18:

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

input:

18

output:

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

result:

ok answer 18 squares of 2 different sizes in total 6 * 6

Test #19:

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

input:

19

output:

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

result:

ok answer 19 squares of 2 different sizes in total 5 * 5

Test #20:

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

input:

20

output:

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

result:

ok answer 20 squares of 3 different sizes in total 7 * 7

Test #21:

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

input:

21

output:

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

result:

ok answer 21 squares of 2 different sizes in total 6 * 6

Test #22:

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

input:

22

output:

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

result:

ok answer 22 squares of 2 different sizes in total 5 * 5

Test #23:

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

input:

23

output:

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

result:

ok answer 23 squares of 3 different sizes in total 7 * 7

Test #24:

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

input:

24

output:

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

result:

ok answer 24 squares of 2 different sizes in total 6 * 6

Test #25:

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

input:

25

output:

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

result:

ok answer 25 squares of 1 different sizes in total 5 * 5

Test #26:

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

input:

29

output:

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

result:

ok answer 29 squares of 3 different sizes in total 7 * 7

Test #27:

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

input:

31

output:

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

result:

ok answer 31 squares of 2 different sizes in total 7 * 7

Test #28:

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

input:

37

output:

Possible
7
1 1 2 2 3 3 5
1 1 2 2 3 3 6
4 4 7 8 9 10 11
4 4 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 32 33 34 35 36 37

result:

ok answer 37 squares of 2 different sizes in total 7 * 7

Test #29:

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

input:

41

output:

Possible
7
1 1 1 2 3 4 5
1 1 1 6 7 8 9
1 1 1 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 32 33 34
35 36 37 38 39 40 41

result:

ok answer 41 squares of 2 different sizes in total 7 * 7

Test #30:

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

input:

43

output:

Possible
7
1 1 2 2 3 4 5
1 1 2 2 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 32 33 34 35 36
37 38 39 40 41 42 43

result:

ok answer 43 squares of 2 different sizes in total 7 * 7

Test #31:

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

input:

47

output:

Possible
8
1 1 1 2 2 3 3 5
1 1 1 2 2 3 3 6
1 1 1 4 4 7 8 9
10 11 12 4 4 13 14 15
16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47

result:

ok answer 47 squares of 3 different sizes in total 8 * 8

Test #32:

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

input:

49

output:

Possible
7
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
36 37 38 39 40 41 42
43 44 45 46 47 48 49

result:

ok answer 49 squares of 1 different sizes in total 7 * 7

Test #33:

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

input:

50

output:

Possible
8
1 1 1 2 2 3 3 4
1 1 1 2 2 3 3 5
1 1 1 6 7 8 9 10
11 12 13 14 15 16 17 18
19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34
35 36 37 38 39 40 41 42
43 44 45 46 47 48 49 50

result:

ok answer 50 squares of 3 different sizes in total 8 * 8

Test #34:

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

input:

57

output:

Possible
9
1 1 2 2 3 3 4 4 9
1 1 2 2 3 3 4 4 10
5 5 6 6 7 7 8 8 11
5 5 6 6 7 7 8 8 12
13 14 15 16 17 18 19 20 21
22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56 57

result:

ok answer 57 squares of 2 different sizes in total 9 * 9

Test #35:

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

input:

61

output:

Possible
8
1 1 2 3 4 5 6 7
1 1 8 9 10 11 12 13
14 15 16 17 18 19 20 21
22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37
38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53
54 55 56 57 58 59 60 61

result:

ok answer 61 squares of 2 different sizes in total 8 * 8

Test #36:

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

input:

79

output:

Possible
10
1 1 2 2 3 3 4 4 5 5
1 1 2 2 3 3 4 4 5 5
6 6 7 7 8 9 10 11 12 13
6 6 7 7 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79

result:

ok answer 79 squares of 2 different sizes in total 10 * 10

Test #37:

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

input:

83

output:

Possible
10
1 1 1 2 2 3 3 4 4 5
1 1 1 2 2 3 3 4 4 6
1 1 1 7 8 9 10 11 12 13
14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 40 41 42 43
44 45 46 47 48 49 50 51 52 53
54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73
74 75 76 77 78 79 80 81 82 83

result:

ok answer 83 squares of 3 different sizes in total 10 * 10

Test #38:

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

input:

87

output:

Possible
12
1 1 2 2 3 3 4 4 5 5 6 6
1 1 2 2 3 3 4 4 5 5 6 6
7 7 8 8 9 9 10 10 11 11 12 12
7 7 8 8 9 9 10 10 11 11 12 12
13 13 14 14 15 15 16 16 17 17 18 18
13 13 14 14 15 15 16 16 17 17 18 18
19 19 20 21 22 23 24 25 26 27 28 29
19 19 30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49 50 51
...

result:

ok answer 87 squares of 2 different sizes in total 12 * 12

Test #39:

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

input:

89

output:

Possible
10
1 1 1 2 2 3 4 5 6 7
1 1 1 2 2 8 9 10 11 12
1 1 1 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89

result:

ok answer 89 squares of 3 different sizes in total 10 * 10

Test #40:

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

input:

90

output:

Possible
12
1 1 2 2 3 3 4 4 5 5 6 6
1 1 2 2 3 3 4 4 5 5 6 6
7 7 8 8 9 9 10 10 11 11 12 12
7 7 8 8 9 9 10 10 11 11 12 12
13 13 14 14 15 15 16 16 17 17 18 18
13 13 14 14 15 15 16 16 17 17 18 18
19 20 21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40 41 42
43 44 45 46 47 48 49 50 51 52 53 54
...

result:

ok answer 90 squares of 2 different sizes in total 12 * 12

Test #41:

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

input:

91

output:

Possible
10
1 1 2 2 3 3 4 5 6 7
1 1 2 2 3 3 8 9 10 11
12 13 14 15 16 17 18 19 20 21
22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41
42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61
62 63 64 65 66 67 68 69 70 71
72 73 74 75 76 77 78 79 80 81
82 83 84 85 86 87 88 89 90 91

result:

ok answer 91 squares of 2 different sizes in total 10 * 10

Test #42:

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

input:

92

output:

Possible
10
1 1 1 2 3 4 5 6 7 8
1 1 1 9 10 11 12 13 14 15
1 1 1 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40 41 42
43 44 45 46 47 48 49 50 51 52
53 54 55 56 57 58 59 60 61 62
63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82
83 84 85 86 87 88 89 90 91 92

result:

ok answer 92 squares of 2 different sizes in total 10 * 10

Test #43:

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

input:

93

output:

Possible
12
1 1 2 2 3 3 4 4 5 5 6 6
1 1 2 2 3 3 4 4 5 5 6 6
7 7 8 8 9 9 10 10 11 11 12 12
7 7 8 8 9 9 10 10 11 11 12 12
13 13 14 14 15 15 16 16 17 17 18 19
13 13 14 14 15 15 16 16 17 17 20 21
22 23 24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54 55 56 57
...

result:

ok answer 93 squares of 2 different sizes in total 12 * 12

Test #44:

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

input:

94

output:

Possible
10
1 1 2 2 3 4 5 6 7 8
1 1 2 2 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34
35 36 37 38 39 40 41 42 43 44
45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64
65 66 67 68 69 70 71 72 73 74
75 76 77 78 79 80 81 82 83 84
85 86 87 88 89 90 91 92 93 94

result:

ok answer 94 squares of 2 different sizes in total 10 * 10

Test #45:

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

input:

95

output:

Possible
11
1 1 1 2 2 3 3 4 4 5 5
1 1 1 2 2 3 3 4 4 5 5
1 1 1 6 6 7 7 8 9 10 11
12 13 14 6 6 7 7 15 16 17 18
19 20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61 62
63 64 65 66 67 68 69 70 71 72 73
74 75 76 77 78 79 80 81 82...

result:

ok answer 95 squares of 3 different sizes in total 11 * 11

Test #46:

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

input:

96

output:

Possible
12
1 1 2 2 3 3 4 4 5 5 6 6
1 1 2 2 3 3 4 4 5 5 6 6
7 7 8 8 9 9 10 10 11 11 12 12
7 7 8 8 9 9 10 10 11 11 12 12
13 13 14 14 15 15 16 16 17 18 19 20
13 13 14 14 15 15 16 16 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56 57 58 59 60
...

result:

ok answer 96 squares of 2 different sizes in total 12 * 12

Test #47:

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

input:

97

output:

Possible
10
1 1 2 3 4 5 6 7 8 9
1 1 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37
38 39 40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57
58 59 60 61 62 63 64 65 66 67
68 69 70 71 72 73 74 75 76 77
78 79 80 81 82 83 84 85 86 87
88 89 90 91 92 93 94 95 96 97

result:

ok answer 97 squares of 2 different sizes in total 10 * 10

Test #48:

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

input:

98

output:

Possible
11
1 1 1 2 2 3 3 4 4 5 5
1 1 1 2 2 3 3 4 4 5 5
1 1 1 6 6 7 8 9 10 11 12
13 14 15 6 6 16 17 18 19 20 21
22 23 24 25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40 41 42 43
44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65
66 67 68 69 70 71 72 73 74 75 76
77 78 79 80 81 82 83 84...

result:

ok answer 98 squares of 3 different sizes in total 11 * 11

Test #49:

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

input:

99

output:

Possible
12
1 1 2 2 3 3 4 4 5 5 6 6
1 1 2 2 3 3 4 4 5 5 6 6
7 7 8 8 9 9 10 10 11 11 12 12
7 7 8 8 9 9 10 10 11 11 12 12
13 13 14 14 15 15 16 17 18 19 20 21
13 13 14 14 15 15 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61 62 63
...

result:

ok answer 99 squares of 2 different sizes in total 12 * 12

Test #50:

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

input:

100

output:

Possible
10
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 ...

result:

ok answer 100 squares of 1 different sizes in total 10 * 10

Extra Test:

score: 0
Extra Test Passed