P5719 【Shenji 4. Example 3】Classified Averages

Description

Given $n$ and $k$, all positive integers from $1$ to $n$ can be divided into two groups. Group A consists of numbers that are divisible by $k$ (that is, multiples of $k$), and Group B consists of numbers that are not. Output the average of each group, accurate to $1$ digit after the decimal point, separated by a space. The testdata guarantees that the number of elements in both groups will not be $0$.

Input Format

Input two positive integers $n$ and $k$.

Output Format

Output one line with two real numbers, representing the averages of Group A and Group B, respectively. Keep exactly one digit after the decimal point.

Explanation/Hint

Constraints: $1 \leq n\leq 10000$, $1 \leq k \leq 100$. Translated by ChatGPT 5