Codeforces Round #235 (Div. 2) A. Vanya and Cards

#include <iostream>
using namespace std;

int main(){
    int n,x;
    cin >> n >> x;
    int sum = 0;
    for(int i = 0 ; i <  n ; ++ i){
        int number;
        cin>>  number;
        sum +=number;
    }
    if(sum < 0) sum = -sum;
    cout<<(sum%x ? sum/x+1 : sum/x) <<endl;
}

 

posted @ 2014-03-12 22:36  OpenSoucre  阅读(207)  评论(0编辑  收藏  举报