#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll n, m, k;
ll N;
bool check(ll x, ll y) {
if (x > N || y > m)return 0;
return 1;
}
void solve() {
scanf("%lld%lld%lld", &n, &m, &k);
N = n;
n = 2 * n * m;
if (n % k != 0) {
cout << "NO\n";
return;
}
n /= k;
for (ll x = max(1ll, n/(max(N,m))); x * x <= n; x ++) {
ll y = n/(x);
if (n % x == 0 ) {
if (!check(x, y)) {
swap(x, y);
if (check(x, y)) {
cout << "YES\n";
cout << "0 0\n";
cout << 0 << " " << y << endl;
cout << x << " " << 0 << endl;
return;
} else swap(x, y);
} else {
cout << "YES\n";
cout << "0 0\n";
cout << 0 << " " << y << endl;
cout << x << " " << 0 << endl;
return;
}
}
}
cout << "NO\n";
}
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
freopen("out.out", "w", stdout);
#endif
ll n = 1;
while (n--) {
solve();
}
return 0;
}
原文:https://www.cnblogs.com/Xiao-yan/p/14835695.html