#include <bits/stdc++.h>
using namespace std;
// FX 9.11: r,rho(r),m(r)
// by Xellos
// integrovane Eulerovou metodou
// jednotky: SI zakladne
typedef long double ld;
// konstanty
ld R =8.314; // univ. plynova konstanta
ld G =6.67e-11; // gravitacna konstanta
ld M =2e-3; // molova hmotnost H2
ld pi =3.1415;
ld dif_rho(ld r, ld rho, ld m, ld T) {
// d(rho)/dr
return -G*M*rho*m/(R*T*pow(r,2));}
ld V(ld r) {
// objem gule s polomerom r
return 4*pi/3*pow(r,3);}
ld S(ld r) {
// povrch gule s polomerom r
return 4*pi*pow(r,2);}
int main() {
cout << scientific << setprecision(4);
// vstupne parametre
ld T; // teplota mraku
ld rho_c; // hustota v strede
ld m_t; // hmotnost mraku
cin >> T >> rho_c >> m_t;
// init ratanych premennych
ld r =1e5; // polomer
ld rho =rho_c; // rho(r)
ld m =V(r)*rho; // m(r)
int t =0, K =10000; // vypisuj len kazdy K-ty riadok
while(m < m_t) {
if((t++)%K == 0)
cout << r << " " << rho << " " << m << "\n";
ld dr =r/1e6; // krok
rho +=dif_rho(r,rho,m,T)*dr;
m +=S(r)*rho*dr;
r +=dr;
if(rho < 0) {
cout << "FAIL\n";
return 0;}
}
return 0;}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Ci8vIEZYIDkuMTE6IHIscmhvKHIpLG0ocikKLy8gYnkgWGVsbG9zCi8vIGludGVncm92YW5lIEV1bGVyb3ZvdSBtZXRvZG91Ci8vIGplZG5vdGt5OiBTSSB6YWtsYWRuZQp0eXBlZGVmIGxvbmcgZG91YmxlIGxkOwoKLy8ga29uc3RhbnR5CmxkIFIgPTguMzE0OwkJCQkJCS8vIHVuaXYuIHBseW5vdmEga29uc3RhbnRhCmxkIEcgPTYuNjdlLTExOwkJCQkJCS8vIGdyYXZpdGFjbmEga29uc3RhbnRhCmxkIE0gPTJlLTM7CQkJCQkJCS8vIG1vbG92YSBobW90bm9zdCBIMgpsZCB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