#include int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n, t; std::cin >> n >> t; std::vector T(n - 1); for (int i = 0; i + 1 < n; i++) { std::cin >> T[i]; } int k; std::cin >> k; std::vector clock(n, false); for (int i = 0; i < k; i++) { int x; std::cin >> x; x--; clock[x] = true; } int cnt = 0; for (int i = 1; i < n; i++) { t -= T[i - 1]; while (t <= 0) { if (cnt > 0) { cnt--; t += 10; } else { std::cout << "-1\n"; return 0; } } if (i + 1 == n) { std::cout << k - cnt << '\n'; return 0; } cnt += (clock[i]); } }