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

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

Problem Description

Given nn and kk, all positive integers from 11 to nn can be divided into two groups. Group A consists of numbers that are divisible by kk (that is, multiples of kk), and Group B consists of numbers that are not. Output the average of each group, accurate to 11 digit after the decimal point, separated by a space.

The testdata guarantees that the number of elements in both groups will not be 00.

Input Format

Input two positive integers nn and kk.

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.

100 16
56.0 50.1

Hint

Constraints: 1n100001 \leq n\leq 10000, 1k1001 \leq k \leq 100.

Translated by ChatGPT 5