Untitled
unknown
plain_text
19 days ago
1.7 kB
1
Indexable
Never
#include <bits/stdc++.h> using namespace std; #define Task "test" #define FOR(i, a, b) for(int i = (a); i < (b); ++i) #define FORD(i, a, b) for(int i = (a); i <= (b); ++i) #define pb push_back #define pf push_front #define fi first #define se second #define endl "\n" #define int long long #define Chris_No_Luv signed main() typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> vi; typedef vector<int> vii; typedef set<int> viii; typedef map<int, int> viiii; const int mod = (int) 1e9 + 7; const int INF = (int) 1e9 + 2804; #bai48 int a, b, c, d, v; Chris_No_Luv { ios_base::sync_with_stdio(0); cin.tie(); cout.tie(); if (fopen(Task".inp", "r")) { freopen(Task".inp", "r", stdin); freopen(Task".out", "w", stdout); } cin >> a >> b >> c >> d >> v; int bien = (-d) / c; int x = a - v * c; int y = b - d * v; if(x == 0) { if(y == 0) { cout << "MULTIPLE" << endl; return 0; } else { cout << "NONE" << endl; return 0; } } else { int m = x, t = y; int ming = __gcd(t, m); t /= ming; m /= ming; if(m < 0) { t = -t; m = -m; } if(-m == bien) { cout << "NONE" << endl; return 0; } if(m == 0) { cout << "NONE" << endl; return 0; } else { cout << t << "/" << m << endl; } } return 0; }
Leave a Comment