#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *// void input() { } long long gcd(long long a, long long b) {if(b==0){return(a);} else{return(gcd(b, a%b));}} std::pair input_deci(int d) { assert(d >= 0); std::string r; std::cin >> r; std::string::size_type rs = r.size(); std::string::size_type rp = r.find('.'); long long r_inte = std::stoll(r.substr(0, rp)); long long r_frac = (rp == std::string::npos) ? 0 : std::stoll(r.substr(rp+1)); if(!(rp == std::string::npos)) while(d-- >= (int)(rs-rp)) { r_frac *= 10; } return {r_inte, r_frac}; } long long input_deci_ll(int d) { std::pair deci = input_deci(d); while(d--) { deci.first *= 10; } return deci.first + deci.second; } void solve() { long long Xs = input_deci_ll(8); long long Xb = (long long)pow(10, 8); long long Xgcd = gcd(Xs, Xb); Xs /= Xgcd; Xb /= Xgcd; cout << Xs << '/' << Xb << endl; } //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *// int main() { std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf()); std::cin.tie(0); ios::sync_with_stdio(false); input(); solve(); return 0; }