#include using namespace std; void pluplus(int posi,string &result_list,char sc){ if(result_list[posi] == *" "){ result_list[posi] = sc; }else{ result_list[posi] = *to_string((sc - '0') + (result_list[posi] - '0')).c_str(); } } void execute(string e_dream_s,int e_posi,int e_k,string &e_result_s){ int mp_result = (e_dream_s[e_posi] - '0') * e_k; int e_size = to_string(mp_result).size(); int e_size_cnt = e_size - 1; if(e_size >= 1){ pluplus(e_posi,e_result_s,to_string(mp_result)[e_size_cnt]);} if(e_size >= 2){ pluplus(e_posi-1,e_result_s,to_string(mp_result)[e_size_cnt-1]);} if(e_size >= 3){ pluplus(e_posi-2,e_result_s,to_string(mp_result)[e_size_cnt-2]);} } int main(){ long k; cin >> k; string dream_s = "0.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991"; string result_s = ""; for(int cnt = dream_s.size()-1;cnt >= 0;cnt--){result_s+=" ";} int posi = dream_s.size()-1; for(auto s:dream_s){ if(posi >= 2) {execute(dream_s, posi, k, result_s);} posi--; } result_s.insert(2,"."); if(result_s[1] == *" "){result_s.insert(1,"0");} for(size_t c = result_s.find_first_of(" "); c != string::npos; c = result_s.find_first_of(" ")){result_s.erase(c,1);} cout << result_s << endl; }