Skip to content

JOIRIS

Unrated
日本語

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
0
Correct
0
Solved by
0
AC rate
—

Statement

問題文 1ページ

問題文 2ページ

問題文 3ページ

問題文 4ページ

問題文 5ページ

Examples

Sample input 1
4 2
1
0
1
2
Sample output 1
4
2 2
1 1
2 3
1 2
Sample input 2
3 2
2
0
1
Sample output 2
3
1 2
1 3
2 1
Sample input 3
2 2
0
1
Sample output 3
-1
Sample input 4
5 3
1
0
1
0
1
Sample output 4
9
1 4
1 5
2 1
2 1
2 2
1 1
1 2
2 3
2 3

Notes

Tags

No tags yet

Source