int maximum(int a, int b){
    return (int)((fabs((long)b - (long)a) + a + b) / 2);
}