Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef KHOKHO
- //#pragma GCC optimize("O3")
- #endif
- #include<bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp> // Common file
- #include <ext/pb_ds/tree_policy.hpp>
- using namespace std;
- using namespace __gnu_pbds;
- //#define CHKR
- #define ll int
- #define pb push_back
- //#define mp make_pair
- #define fr first
- #define sc second
- #define ARRS int(1e5+500)
- #define BARRS int(6e4+600)
- #define MAX ((long long)(1e15+1))
- #define MX ((long long)(1e5+25))
- #define EP ((double)(1e-12))
- #define MMAX ((long long)(1e9+10))
- #define HS1 ((long long)(1000001329))
- #define HS2 ((long long)(1000001531))
- #define MOD ((long long)1000000007ll)
- #define SQ 31622780
- #define PI 3.14159265358979323846264338327950288419716939937510
- #define BG 4294967232ll
- #define MH 200008
- #define LG 18
- pair<ll,ll> a[4];
- int main(){
- #ifdef KHOKHO
- freopen("in.in","r",stdin);
- freopen("out.out","w+",stdout);
- #endif //KHOKHO
- ll q=1;
- 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)){
- sort(a,a+3);
- bool e=1;
- bool p=0;
- while(e){
- for(int i=0; i<2; i++){
- for(int i=0; i<2; i++){
- for(int i=0; i<2; i++){
- 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)
- p=1;
- 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)
- p=1;
- swap(a[2].fr,a[2].sc);
- }
- swap(a[1].fr,a[1].sc);
- }
- swap(a[0].fr,a[0].sc);
- }
- e=next_permutation(a,a+3);
- }
- if(p)cout<<"Case #"<<q<<": YES\n";
- else cout<<"Case #"<<q<<": NO\n";
- q++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement