import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int q = sc.nextInt(); int[] t = new int[n]; for (int i = 0; i < n; i++) { t[i] = sc.nextInt(); } long[] a = new long[n + 1]; for (int i = 0; i < n; i++) { a[i + 1] = a[i] + t[i]; } PrintWriter pw = new PrintWriter(System.out); for (int i = 0; i < q; i++) { long x = sc.nextLong(); int idx = binarySearch(a, x); pw.println(idx); } pw.flush(); sc.close(); } static int binarySearch(long[] array, long val) { int ng = array.length; int ok = -1; while (Math.abs(ok - ng) > 1) { int mid = (ok + ng) / 2; if (array[mid] <= val) { ok = mid; } else { ng = mid; } } return ok; } }