样例过了,但是全WA,求指教
查看原帖
样例过了,但是全WA,求指教
1200833
TDBRX_楼主2023/11/27 16:35
#include<iostream> 
  
#include<cstring>
  
#include<cstdio>
  
using namespace std;
  
int n, k;
  
double x, y;
  
long long p = 0, q = 0, t = 0;

int main()
{
	
	cin >> n >> k;
	
	for (int i = k; i <= n; i += k)
	{
		p += i;
		t += 1;
	}
	q = (1 + n) * n / 2 - p;
	x = 1.0 * p / t;
	y = 1.0 * q / (100 - t);
	printf("%.1lf %.1lf", x, y);
}
 ```  ```
2023/11/27 16:35
加载中...