Advertisement
sandro1234

Untitled

Jun 23rd, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. #ifndef KHOKHO
  2. //#pragma GCC optimize("O3")
  3. #endif
  4. #include<bits/stdc++.h>
  5. #include <ext/pb_ds/assoc_container.hpp> // Common file
  6. #include <ext/pb_ds/tree_policy.hpp>
  7. using namespace std;
  8. using namespace __gnu_pbds;
  9. //#define CHKR
  10. #define ll int
  11. #define pb push_back
  12. //#define mp make_pair
  13. #define fr first
  14. #define sc second
  15. #define ARRS int(1e5+500)
  16. #define BARRS int(6e4+600)
  17. #define MAX ((long long)(1e15+1))
  18. #define MX ((long long)(1e5+25))
  19. #define EP ((double)(1e-12))
  20. #define MMAX ((long long)(1e9+10))
  21. #define HS1 ((long long)(1000001329))
  22. #define HS2 ((long long)(1000001531))
  23. #define MOD ((long long)1000000007ll)
  24. #define SQ 31622780
  25. #define PI 3.14159265358979323846264338327950288419716939937510
  26. #define BG 4294967232ll
  27. #define MH 200008
  28. #define LG 18
  29. pair<ll,ll> a[4];
  30. int main(){
  31.     #ifdef KHOKHO
  32.         freopen("in.in","r",stdin);
  33.         freopen("out.out","w+",stdout);
  34.     #endif //KHOKHO
  35. ll     q=1;
  36.     while(EOF!=scanf("%d%d%d%d%d%d",&a[0].fr,&a[0].sc,&a[1].fr,&a[1].sc,&a[2].fr,&a[2].sc)){
  37.     sort(a,a+3);
  38.     bool e=1;
  39.     bool p=0;
  40.     while(e){
  41.         for(int i=0; i<2; i++){
  42.             for(int i=0; i<2; i++){
  43.                 for(int i=0; i<2; i++){
  44.                     if(a[0].fr+a[1].fr+a[2].fr==a[0].sc&&a[0].sc==a[1].sc&&a[1].sc==a[2].sc)
  45.                         p=1;
  46.                     if(a[0].fr+a[1].fr==a[2].fr+a[1].fr&&a[0].sc+a[2].sc==a[1].sc&&a[1].sc==a[0].fr+a[1].fr)
  47.                         p=1;
  48.                     swap(a[2].fr,a[2].sc);
  49.                 }
  50.                     swap(a[1].fr,a[1].sc);
  51.             }
  52.                     swap(a[0].fr,a[0].sc);
  53.         }
  54.         e=next_permutation(a,a+3);
  55.     }
  56.     if(p)cout<<"Case #"<<q<<": YES\n";
  57.     else cout<<"Case #"<<q<<": NO\n";
  58.     q++;
  59. }
  60.     return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement