#include<bits/stdc++.h>
using namespace std;
int n,q;
long long a[100010];
long long x[100010];
int main(){
	cin>>n>>q;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)x[i]=a[i]-i;
	long long id;
	while(q--){
		cin>>id;
		long long ans;
		if(id>x[n]){
			ans=id-x[n]+a[n];
			cout<<ans<<endl;
			continue;
		}
		int pos=lower_bound(x+1,x+n+1,id)-x;
		ans=id-x[pos-1]+a[pos-1];
		cout<<ans<<endl;	
	}
} 
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <functional>
#include <numeric>
#include <iomanip> 
#include <stdio.h>
//eolibraries
#define lnf 3999999999999999999
#define inf 999999999
#define PI 3.14159265359
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define ll long long
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define mkp(a,b) make_pair(a,b)
#define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define rsz(a,n) a.resize(n)
#define pii pair <int,int>
#define rep(i,n) for(int i = 0 ; i < n ; i++) 
#define drep(i,n) for(int i = n-1 ; i >= 0 ; i--)
#define crep(i,x,n) for(int i = x ; i < n ; i++)
#define vi vector <int> 
#define vec(s) vector<s>
#define rsz(a,n) a.resize(n)
#define rszv(a,n,v) a.resize(n,v)
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
//eodefine

const int max_n = 100000;

using namespace std;

int main(){
fcin;
	int n,k;
	cin>>n>>k;
	int ans=0;
	crep(i,1,n+1) {
		crep(j,1,k+1) {
			ans += i*100+j;
		}
	}
	cout << ans << "\n";
/*
*/

    return 0;   
}