题解:UVA13108 Juanma and the Drinking Fountains
_second_coming_ · · 题解
题意
在一个圆的周长上选
解法
直接从样例中找规律,可得最大区域数
code
#include <iostream>
int main() {
int T;
cin >> T;
while (T--) { // 读入T组数据
int n;
cin >> n;
cout << 1 + n * (n - 1) / 2 + n * (n - 1) * (n - 2) * (n - 3) / 24
<< '\n';
}
return 0;
}