#include<cstdio>
using namespace std;
int main() {
int n, k, A_sum, B_sum;
scanf("%d%d", &n, &k);
A_sum = k * (n / k) + ((n / k) * (n / k - 1) * k) / 2;
B_sum = (1 + n) * n / 2 - A_sum;
printf("%.1f ", double(A_sum) / (n / k));
printf("%.1f", double(B_sum) / (n - n / k));
return 0;
}
/*#include<iostream>
using namespace std;
int main() {
int a, days = 1;
cin >> a;
while (a > 1)
days++, a /= 2;
cout << days << endl;
return 0;
}*/
#include<iostream>
using namespace std;
int main() {
int a, days = 1;
cin >> a;
for (a; a > 1; a /= 2)
days++;
cout << days << endl;
return 0;
}
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main() {
int ran;
srand(time(0));
ran = rand();
cout << ran;
return 0;
}
#include<iostream>
#include<cstdio>
#include<ctime>
using namespace std;
int main() {
int ans, guess;
srand(time(0));
ans = rand() % 100 + 1;
do {
cin >> guess;
if (guess < ans)
cout << "Too small" << endl;
if (guess > ans)
cout << "Too large" << endl;
} while (ans != guess);
cout << "You are right!!" << endl;
return 0;
}
/*#include<cstdio>
using namespace std;
int main() {
int n, num = 1;
scanf("%d", &n);
while (n > 0) {
for (int i = 0; i < n; i++){
printf("%02d", num);
num += 1;
}
printf("\n");
n--;
}
return 0;
}*/
/*#include<cstdio>
using namespace std;
int main() {
int cnt = 1, n;
scanf("%d", &n);
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n - i + 1; j++)
printf("%02d", cnt++);
printf("\n");
}
return 0;
}*/
#include<cstdio>
using namespace std;
int main() {
int cnt = 0, n, k, cn;
scanf("%d", &n);
k = n, cn = n;
for (int i = 1; i <= n * (n + 1) / 2; i++) {
printf("%02d", ++cnt);
if (i == cn) {
printf("\n");
k--, cn += k;
}
}
return 0;
}
/* 3
1145 1419
1981 0
3000 4000 */
#include<bits/stdc++.h>
using namespace std;
string myfun(int x) {
if (x > 0 && x <= 1199)
return "Newbie";
else if (x >= 1200 && x <= 1399)
return "Pupil";
else if (x >= 1400 && x <= 1599)
return "Specialist";
else if (x >= 1600 && x <= 1899)
return "Expert";
else if (x >= 1900 && x <= 2099)
return "Candidate Master";
else if (x >= 2100 && x <= 2399)
return "Master";
else if (x >= 2400 && x <= 2999)
return "Grandmaster";
else if (x >= 3000)
return "Legendary Grandmaster";
}
int main() {
int n;
cin >> n;
for (n; n > 0; n--){
int past, now;
cin >> past >> now;
string s1,s2;
s1 = myfun(past);
s2 = myfun(now);
if (s1 == s2 )
cout << "No" << endl;
else
cout << s1 << " to " << s2 << endl;
}
return 0;
}
04-29
1812
08-14
2765
06-20
3880
10-02