Skip to content

歴史の研究 (Historical Research)

Unrated
日本語

Language

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

Statement

歴史の研究 (Historical Research):公式日本語問題文 1ページ

歴史の研究 (Historical Research):公式日本語問題文 2ページ

歴史の研究 (Historical Research):公式日本語問題文 3ページ

歴史の研究 (Historical Research):公式日本語問題文 4ページ

Examples

Sample input 1
5 5
9 8 7 8 9
1 2
3 4
4 4
1 4
2 4
Sample output 1
9
8
8
16
16
Sample input 2
8 4
9 9 19 9 9 15 9 19
1 4
4 6
3 5
5 8
Sample output 2
27
18
19
19
Sample input 3
12 15
15 9 3 15 9 3 3 8 16 9 3 17
2 7
2 5
2 2
1 12
4 12
3 6
11 12
1 7
2 6
3 5
3 10
7 10
1 4
4 8
4 8
Sample output 3
18
18
9
30
18
15
17
30
18
15
18
16
30
15
15

Notes

Tags

No tags yet

Source