样例过了,但是全WA,求指教

P5719 【深基4.例3】分类平均

TDBRX_ @ 2023-11-27 16:35:54


#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);
}
 ```  ```

|