#include #include #include #include using namespace std; using namespace atcoder; using namespace __gnu_pbds; using ll=long long; using ld=long double; using vll=vector; using vvll=vector; using pll=pair; // using mint=modint; // template // using ordered_map=tree,rb_tree_tag,tree_order_statistics_node_update>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,s=0; cin>>N; for(int i=1,a;i<=N;++i)cin>>a,s+=a; //鶴の数をxとして、亀はN-x //「全員の足の総本数」は鶴から見ると、(2*x+4*(N-x)-2)となる、亀から見ると、(2*x+4*(N-x)-4)となる //従って、s=(2*x+4*(N-x)-2)*x+(2*x+4*(N-x)-4)*(N-x)=4*N*N-2Nx-4N+2x <=> (s-4*N*N+4N)/(-2N+2)=x ll x=(s-4*N*N+4*N)/(-2*N+2); cout<