Pagini recente » Cod sursa (job #2940058) | Cod sursa (job #2717835) | Cod sursa (job #3181829) | Cod sursa (job #791502) | 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';
}
}
}