mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 00:48:47 +00:00
24 lines
453 B
C++
24 lines
453 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int t, a, b, c, d, k, x, y;
|
|
|
|
int main() {
|
|
cin >> t;
|
|
while (t--) {
|
|
cin >> a >> b >> c >> d >> k;
|
|
try {
|
|
x = ceil(1.0 * a / c);
|
|
y = ceil(1.0 * b / d);
|
|
if (x + y > k) {
|
|
throw "No answer";
|
|
}
|
|
cout << x << ' ' << y << endl;
|
|
} catch (...) {
|
|
cout << -1 << endl;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|