#include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second using namespace std; typedef long long ll; typedef pair pii; const int maxn=100010; ll N[maxn]; int main() { int T; scanf("%d",&T); while (T--) { int n,k; scanf("%d%d",&n,&k); for (int i=1;i0;i--) sum+=N[i]; sum+=n; cout<