#include <iostream>
using namespace std;
double sum(double a1, double an, int n){
return (a1 + an)*n/2; // арифмитическая прогрессия с d = 1
}
signed main(){
double ans = 0;
for(double i = 1; i <= 6; i++)
ans += 1/sum(1,i,int(i));
cout << ans;
double sum = 0, ans = 0;
for(int i = 1; i < 7; i++){
sum += i;
ans += 1/sum;
#include <iostream>
using namespace std;
double sum(double a1, double an, int n){
return (a1 + an)*n/2; // арифмитическая прогрессия с d = 1
}
signed main(){
double ans = 0;
for(double i = 1; i <= 6; i++)
ans += 1/sum(1,i,int(i));
cout << ans;
}
#include <iostream>
using namespace std;
signed main(){
double sum = 0, ans = 0;
for(int i = 1; i < 7; i++){
sum += i;
ans += 1/sum;
}
cout << ans;
}