Skip to content

JOI 国のお祭り事情 (Festivals in JOI Kingdom)

Unrated
日本語

Language

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

Statement

JOI 国のお祭り事情 (Festivals in JOI Kingdom):公式問題文 1ページ

JOI 国のお祭り事情 (Festivals in JOI Kingdom):公式問題文 2ページ

JOI 国のお祭り事情 (Festivals in JOI Kingdom):公式問題文 3ページ

JOI 国のお祭り事情 (Festivals in JOI Kingdom):公式問題文 4ページ

Examples

Sample input 1
6 6 2 3
1 2 5
2 3 4
2 4 6
3 5 9
4 5 3
5 6 7
1
6
3 4
5 2
1 4
Sample output 1
7
5
0
Sample input 2
12 17 2 5
1 3 6
1 6 7
2 3 8
2 4 4
2 8 11
2 12 2
3 6 3
3 7 8
3 11 2
4 12 2
5 10 3
6 10 5
8 9 6
8 12 7
9 10 6
11 9 10
12 9 5
8
7
2 6
5 2
1 10
8 9
9 4
Sample output 2
8
8
11
0
6

Notes

Tags

No tags yet

Source