Advertisement
ahmedalaaaz

Untitled

Sep 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. long long n,m,k,area,a,b;
  6. vector<pair<long long,long long> >div1,div2;
  7. void done(long long x,long long y){
  8. cout<<"YES\n";
  9. cout<<"0 0\n";
  10. cout<<0<<" "<<y<<"\n";
  11. cout<<x<<" "<<1;
  12. }
  13. bool can(long long x,long long y){
  14. return x >=0 && x<= n && y>=0 && y<=m;
  15. }
  16. long long int gcd(long long int a,long long int b){
  17. return !a ? b: gcd(b%a,a);
  18. }
  19. int main()
  20. {
  21. long long int n,m,k;
  22. cin>>n>>m>>k;
  23. if((2*n*m)%k){
  24. return cout<<"NO",0;
  25. }
  26. cout<<"YES\n";
  27. cout<<"0 0\n";
  28. if(k%2 == 0){
  29. k/=2;
  30. long long int g = gcd(n,k);
  31. cout<<n/g<<" "<<0<<endl;
  32. cout<<0<<" "<<(m/(k/g));
  33. return 0;
  34. }
  35. long long int gg = gcd(n,k);
  36. if(gg == 1)m*=2;
  37. else n*=2;
  38. cout<<n/gg<<" "<<0<<endl;
  39. cout<<0<<" "<<(m/(k/gg));
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement