Pagini recente » Cod sursa (job #1039515) | Cod sursa (job #2370902) | Cod sursa (job #670039) | Cod sursa (job #2455065) | Cod sursa (job #2605876)
#define fisier "ULTRA"
#include <fstream>
std::ifstream in(fisier ".in");
std::ofstream out(fisier ".out");
int main()
{
int t; in >> t;
while (t--)
{
int a, b, c, x, y; in >> a >> b >> c;
bool swp = false;
if (a < b)
{
std::swap(a, b);
swp = true;
}
x = c / a;
y = (c - x*a) / b;
if (a % b != c - x*a - y*b)
out << "0 0\n";
else
{
x++;
y -= a / b;
if (swp)
std::swap(x, y);
out << x << ' ' << y << '\n';
}
}
}