#ifdef _DEBUG #define _GLIBCXX_DEBUG #endif #include #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; //-------------------------------------------------------------------- #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define overload4(_1,_2,_3,_4,name,...) name #define rep1(n) for(ll _=0;_<(ll)n;++_) #define rep2(i,n) for(ll i=0;i<(ll)n;++i) #define rep3(i,a,b) for(ll i=(ll)a;i<(ll)b;++i) #define rep4(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c) #define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__) #ifdef _DEBUG #define pass(...) __VA_ARGS__ ; #define debug1(a) cerr<<#a<<": "<ostream& operator<<(ostream& os,const pair& pp) {return os << "{" << pp.first << "," << pp.second << "}";} templateostream& operator<<(ostream& os,const vector& VV) {if(VV.empty())return os<<"[]";os<<"[";rep(i,VV.size())os<ostream& operator<<(ostream& os,const set& SS) {if(SS.empty())return os<<"[]";os<<"[";auto ii=SS.begin();for(;ii!=SS.end();ii++)os<<*ii<<(ii==prev(SS.end())?"]":",");return os;} templateostream& operator<<(ostream& os,const map& MM) {if(MM.empty())return os<<"[]";os<<"[";auto ii=MM.begin();for(;ii!=MM.end();ii++)os<<"{"<first<<":"<second<<"}"<<(ii==prev(MM.end())?"]":",");return os;} const int inf = 1 << 30; const ll INF = 1LL << 61; const ld pi = 3.14159265358; const ll mod1 = 1000000007LL; const ll mod2 = 998244353LL; // typedef pair P; template inline bool chmin(T& a, const U& b){ if(a > b){ a = b; return 1; } return 0; } template inline bool chmax(T& a, const U& b){ if(a < b){ a = b; return 1; } return 0; } ll modpow(ll n,ll m,ll MOD){ if(m == 0)return 1; if(m < 0)return 0; ll res = 1; n %= MOD; while(m){ if(m & 1)res = (res * n) % MOD; m >>= 1; n *= n; n %= MOD; } return res; } ll mypow(ll n,ll m){ if(m == 0)return 1; if(m < 0)return -1; ll res = 1; while(m){ if(m & 1)res = (res * n); m >>= 1; n *= n; } return res; } inline bool isp(ll n){ bool res = true; if(n == 1 || n == 0)return false; else{ for(ll i = 2;i * i <= n;i++){ if(n % i == 0){ res = false; break; } } return res; } } inline bool Yes(bool b = 1){cout << (b ? "Yes\n":"No\n");return b;} inline bool YES(bool b = 1){cout << (b ? "YES\n":"NO\n");return b;} map primefactor(ll n){ map ma; if(n <= 1)return ma; ll m = n; for(ll i = 2;i * i <= n;i++){ while(m % i == 0){ ma[i]++; m /= i; } } if(m != 1)ma[m]++; return ma; } vector divisor(ll n,bool sorted = true,bool samein = false){ vector res; for(ll i = 1;i * i <= n;i++){ if(n % i == 0){ res.push_back(i); if(i * i != n || samein)res.push_back(n / i); } } if(sorted)sort(all(res)); return res; } ll __lcm(ll a,ll b){return a / __gcd(a,b) * b;} templateT sum(const vector &V){T r=0;for(auto x:V)r+=x;return r;} templateT sum(const initializer_list &V){T r=0;for(auto x:V)r+=x;return r;} // #include // using namespace atcoder; //-------------------------------------------------------------------- long long x10(const std::string& s,size_t n){ if(s.front() == '-')return -x10(s.substr(1),n); auto pos = s.find('.'); if(pos == std::string::npos)return stoll(s + std::string(n,'0')); else return stoll(s.substr(0,pos) + s.substr(pos + 1) + std::string(n + pos + 1 - s.size(),'0')); } template struct rationary{ using D = long double; T den,num; rationary(T num_ = T(0),T den_ = T(1)):den(den_),num(num_){ norm(); } void norm(){ assert(den != 0); if(den < 0)den = -den,num = -num; T g = std::gcd(den,num); den /= g;num /= g; } inline rationary operator-(){(*this).num *= -1;return (*this);} inline const rationary& operator+=(const rationary& a)noexcept{ num = num * a.den + a.num * den; den = den * a.den; norm(); return *this; } inline const rationary& operator-=(const rationary& a)noexcept{ num = num * a.den - a.num * den; den = den * a.den; norm(); return *this; } inline const rationary& operator*=(const rationary& a)noexcept{ num *= a.num; den *= a.den; norm(); return *this; } inline const rationary& operator/=(const rationary& a)noexcept{ num *= a.den; den *= a.num; norm(); return *this; } inline constexpr const rationary operator+(const rationary& a)const noexcept{return rationary(*this) += a;} inline constexpr const rationary operator-(const rationary& a)const noexcept{return rationary(*this) -= a;} inline constexpr const rationary operator*(const rationary& a)const noexcept{return rationary(*this) *= a;} inline constexpr const rationary operator/(const rationary& a)const noexcept{return rationary(*this) /= a;} inline rationary inv()const{return rationary(den,num);} inline bool operator==(const rationary& a)const noexcept{return num == a.num && den == a.den;} inline bool operator!=(const rationary& a)const noexcept{return !(rationary(*this) == a);} inline bool operator<(const rationary& a)const noexcept{return __int128_t(num) * a.den < __int128_t(a.num) * den;} inline bool operator>(const rationary& a)const noexcept{return a < rationary(*this);} inline bool operator<=(const rationary& a)const noexcept{return !(a > rationary(*this));} inline bool operator>=(const rationary& a)const noexcept{return !(a < rationary(*this));} inline D to_D()const{return D(num) / den;} inline friend std::ostream& operator<<(std::ostream& os,const rationary& a){ if(a.den == 1)return os << a.num; else return os << a.num << " / " << a.den; } inline friend const rationary abs(const rationary& a){return (a.num < 0 ? rationary(-a.num,a.den) : rationary(a.num,a.den));} }; using frac = rationary; int main(){ myset(); string S; cin >> S; int sz = S.size(); int e = 0; rep(i,sz){ if(S[i] == '.')e = sz - i - 1; } ll N = x10(S,e); auto ans = frac(N,mypow(10,e)); cout << ans.num << "/" << ans.den << "\n"; debug(N,e); }