#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>n; int m=n; chmin(n,k); vector a(n); rep(i,n) cin>>a[i]; map bitmemo; ll mini=LINF; for(int bit=0;bit<(1<>i)&1)sum+=a[i]; if(bitmemo.count(sum)){ int p=bitmemo[sum],q=bit; rep(i,n){ if(((p>>i)&1) and (((q>>i)&1))){ p^=(1<=n) cout<<0<<(i+1==m?"\n":" "); if((p>>i)&1) cout<>i)&1) cout<<-a[i]; else cout<<0; cout<<(i+1==m?"\n":" "); } return 0; }else{ bitmemo[sum]=bit; } } return 0; }