Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <vector>#include <algorithm>using namespace std;const int N = 100000;int a[N];int n, k;int getScore(int t){int res = 0;int rest = 0;for(int i = 0; i < n; ++i){rest = rest + t;if(rest > a[i]) {res++;rest = rest-a[i];}elserest = 0;}return res;}int main(){while(cin >> n >> k){for(int i = 0; i < n; ++i)