招待 (Invitation)
Unrated
日本語
Language
Contribute a translation- Time limit
- 3000 ms
- Memory limit
- 128 MB
- Submissions
- 0
- Correct
- 0
- Solved by
- 0
- AC rate
- —
Statement
Examples
Sample input 1
5 6 3 4 2 4 1 3 20 1 2 2 4 40 4 5 2 3 30 4 4 4 6 10
Sample output 1
280
Sample input 2
10 10 1 2 1 5 1 5 3 6 10 6 10 4
Sample output 2
-1
Notes
JOI 2011/2012 招待 · JCIOI · CC BY-SA 4.0
Tags
No tags yet