Input
The first line contains three integers: n is the total number of stones, m is the number of moments when Luke gets distracted and k (1 ≤ n, m ≤ 105, 1 ≤ k ≤ 109). Next n lines contain the stones’ weights w i (in kilograms) in the order Luke is going to raise them (1 ≤ w i ≤ 104). Next m lines contain moments t i, when Luke gets distracted by some events (1 ≤ t i ≤ 109, t i < tOutput
Print a single integer ― the number of seconds young Skywalker needs to complete the exercise.Sample
| input | output |
|---|---|
5 1 4 1 2 3 4 5 4 |
8 |