Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) D. Vasya and Triangle
程序员文章站
2022-05-09 22:49:50
...
题目链接:http://codeforces.com/contest/1058/problem/D
c++代码:
#include <iostream>
using namespace std;
typedef long long LL;
LL gcd(LL a,LL b) {
return b==0?a:gcd(b,a%b);
}
int main() {
LL n,m,k;
cin >> n >> m >> k;
if(2*n*m%k)cout <<"NO" <<endl;
else {
LL g=gcd(2*n,k);
cout << "YES" <<endl;
cout << 0 <<" "<<0 <<endl;
if(g==1) {
cout << n <<" " <<0 <<endl;
cout << 0 << " " << 2*m/k <<endl;
}
else {
cout << 2*n/g<<" "<<0<<endl;
cout <<0<<" "<<m*g/k <<endl;
}
}
return 0;
}
推荐阅读
-
Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) D. Vasya and Triangle
-
Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1)
-
Codeforces Round #512 (Div. 2) D. Vasya and Triangle
-
Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1)
-
Codeforces Round #512 (Div. 2) - D. Vasya and Triangle (皮克公式)
-
Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1)(ABCD总结)
-
Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2):D. Minimum path(思维)
-
Technocup 2019 - Elimination Round 1 D. Vasya and Triangle