make( int , n) ;
RE ( i, n) {
cin >> l[ i] >> a[ i] ;
}
RE ( ver, n) {
RE ( hor, n) {
a[ hor] - = 2 ;
a[ ver] - = 2 ;
int h = l[ ver] ;
int cur_wid = 0 ;
int taken = 0 ;
if ( a[ hor] < 0 || a[ ver] < 0 || ( hor ! = n && ver ! = n) ) {
goto A;
}
RE ( now, n) {
if ( now == ver || a[ now] == 0 ) { continue ; }
if ( h == 1 ) { goto A; }
int bl = ( a[ now] + h - 2 ) / ( h - 1 ) ;
cur_wid + = bl * l[ now] ;
a[ ver] - = bl;
taken + = bl;
}
if ( cur_wid == l[ hor] ) {
taken-- ;
a[ ver] ++ ;
}
if ( a[ ver] < 0 || a[ ver] > l[ hor] - cur_wid - ( a[ ver] ! = 0 ) ) {
goto A;
}
cout << "YES\n " ;
debug3( hor, ver, cur_wid) ;
return 0 ;
A: ;
a[ hor] + = 2 ;
a[ ver] + = 2 ;
a[ ver] + = taken;
}
}
cout << "NO\n " ;
ICBtYWtlKGludCwgbik7CiAgUkUgKGksIG4pIHsKICAgIGNpbj4+bFtpXT4+YVtpXTsKICB9CiAgUkUgKHZlciwgbikgewogICAgUkUgKGhvciwgbikgewogICAgICBhW2hvcl0gLT0gMjsKICAgICAgYVt2ZXJdIC09IDI7CiAgICAgIGludCBoID0gbFt2ZXJdOwogICAgICBpbnQgY3VyX3dpZCA9IDA7CiAgICAgIGludCB0YWtlbiA9IDA7CiAgICAgIGlmIChhW2hvcl0gPCAwIHx8IGFbdmVyXSA8IDAgfHwgKGhvciAhPSBuICYmIHZlciAhPSBuKSkgewogICAgICAgIGdvdG8gQTsKICAgICAgfQogICAgICBSRSAobm93LCBuKSB7CiAgICAgICAgaWYgKG5vdyA9PSB2ZXIgfHwgYVtub3ddID09IDApIHsgY29udGludWU7IH0KICAgICAgICBpZiAoaCA9PSAxKSB7IGdvdG8gQTsgfQogICAgICAgIGludCBibCA9IChhW25vd10gKyBoIC0gMikgLyAoaCAtIDEpOwogICAgICAgIGN1cl93aWQgKz0gYmwgKiBsW25vd107CiAgICAgICAgYVt2ZXJdIC09IGJsOwogICAgICAgIHRha2VuICs9IGJsOwogICAgICB9CiAgICAgIGlmIChjdXJfd2lkID09IGxbaG9yXSkgewogICAgICAgIHRha2VuLS07CiAgICAgICAgYVt2ZXJdKys7CiAgICAgIH0KICAgICAgaWYgKGFbdmVyXSA8IDAgfHwgYVt2ZXJdID4gbFtob3JdIC0gY3VyX3dpZCAtIChhW3Zlcl0gIT0gMCkpIHsKICAgICAgICBnb3RvIEE7CiAgICAgIH0KICAgICAgY291dDw8IllFU1xuIjsKICAgICAgZGVidWczKGhvciwgdmVyLCBjdXJfd2lkKTsKICAgICAgcmV0dXJuIDA7CiAgICAgIEE6IDsKICAgICAgYVtob3JdICs9IDI7CiAgICAgIGFbdmVyXSArPSAyOwogICAgICBhW3Zlcl0gKz0gdGFrZW47CiAgICB9CiAgfQogIGNvdXQ8PCJOT1xuIjs=
compilation info
prog.cpp:1:13: error: 'n' has not been declared
make(int, n);
^
prog.cpp:1:15: error: expected constructor, destructor, or type conversion before ';' token
make(int, n);
^
prog.cpp:2:6: error: expected constructor, destructor, or type conversion before '(' token
RE (i, n) {
^
prog.cpp:5:6: error: expected constructor, destructor, or type conversion before '(' token
RE (ver, n) {
^
stdout