Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<iostream>#include<numeric>#include<vector>using namespace std;const int MAX_VAL = 100;void Find_Max(vector<int> ForgetDay, int M,int N){int max = 0;if (M >= N){max= MAX_VAL;}else{vector<int>::iterator it_first = ForgetDay.begin();vector<int>::iterator it_second = it_first + M+1;max =*it_first-1;for (; it_second != ForgetDay.end();it_first++,it_second++){max = max > (*it_second - *it_first-1) ? max : (*it_second - *it_first-1);vector<int>::iterator it_diff1 = it_second;vector<int>::iterator it_diff2 = it_second+1;for (; it_diff2 != ForgetDay.end(); it_diff2++, it_diff1++){max = max > (*it_diff2 - *it_diff1-1) ? max : (*it_diff2 - *it_diff1-1);}}}cout << max << endl;}int main(int argc, char*argv[]){int T, N, M;cin >> T;for (int i = 0; i < T; i++){cin >> N >> M;vector<int> ForgetDay(N);