Bucket and Water Flow codechef solution in c++
#include<iostream> #define ll long long #include<vector> #include<stack> #include<string> #include<algorithm> using namespace std; void solve() { ll w, x, y, z, total; cin >> w >> x >> y >> z; total = w + (y * z); if (total == x) { cout << "filled\n"; } else if (total > x) { cout << "overFlow\n"; } else { cout << "Unfilled\n"; } } int main() { int t; cin >> t; while (t--) { solve(); } return 0; }
Source: www.codegrepper.com