我這渣渣英語和語文,讀題太艱難了。。。。。
因爲要留下更多的人,也就是走更少的人。
1.一個都不走是不可能的。
2.犧牲1個,每個人跟別人都是朋友,都有(n-1)個朋友,都要離開。
3.犧牲2個,1、2號互相之間不是朋友,與其他人都是朋友,1、2號有(n-2)個朋友,其他人都有(n-1)個朋友,1、2號離開後,剩下的人都有(n-3)個朋友,都可以留下。
4.只有1或2個人時,無論怎樣都留不下。
#include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
cout << max(0, n - 2) << endl;
}
return 0;
}