D. Vasya and Triangle(构造)
程序员文章站
2022-03-30 08:23:58
...
int main() //构造
{
//freopen("in.txt", "r", stdin);
ll m, n, k;
while (cin >> n >> m >> k)
{
if (2 * n*m%k != 0) { puts("NO");continue; }
ll d = gcd(2 * m, k);
puts("YES");
cout << "0 0" << endl;
if (d == 1)//n%k==0
{
cout << n * 2 / k <<" "<<0<< endl;
cout << 0 << " " << m << endl;
}
else
{
cout << n*d/k << " " << 0 << endl;
cout << 0 << " " << m * 2 / d << endl;
}
}
return 0;
}
推荐阅读
-
D. Time to Run-1301(构造)
-
D. Make Them Equal(思维+构造)
-
D. Pair of Topics(构造+排序+优化处理)Codeforces Round #627 (Div. 3)
-
Codeforces Raif Round 1 (Div. 1 + Div. 2) D. Bouncing Boomerangs(思维+构造)
-
Educational Codeforces Round 55 (Rated for Div. 2) D. Maximum Diameter Graph (构造图)
-
Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) D. Vasya and Triangle
-
Codeforces Round #512 (Div. 2) D. Vasya and Triangle
-
Codeforces Round #512 (Div. 2) - D. Vasya and Triangle (皮克公式)
-
Educational Codeforces Round 50 (Rated for Div. 2) D. Vasya and Arrays(前缀和,思维)
-
Codeforces Round #630 (Div. 2) D. Walk on Matrix(思维+构造)