Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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
";
	}
	else if (total > x)
	{
		cout << "overFlow
";
	}
	else
	{
		cout << "Unfilled
";
	}
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Bucket #Water #Flow #codechef #solution
ADD COMMENT
Topic
Name
9+9 =