Problem:
Score : 100 points

Problem Statement

We have two integers: A and B.

Print the largest number among A + B, A - B, and A \times B.

Constraints

All values in input are integers.

-100 \leq A,\ B \leq 100

Input

Input is given from Standard Input in the following format:

A B

Output

Print the largest number among A + B, A - B, and A \times B.

Sample Input 1

-13 3

Sample Output 1

-10

The largest number among A + B = -10, A - B = -16, and A \times B = -39 is -10.

Sample Input 2

1 -33

Sample Output 2

34

The largest number among A + B = -32, A - B = 34, and A \times B = -33 is 34.

Sample Input 3

13 3

Sample Output 3

39

The largest number among A + B = 16, A - B = 10, and A \times B = 39 is 39.

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Text; 
using System.Collections.Generic;
using System.Linq;

public class Remainder
{
    static long N;
    static long A;
    static long B;
    static long C;
    static long ans = long.MaxValue;
    static public void Main ()
    {
        var NABC = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        A = NABC[0];
        B = NABC[1];

        
Console.WriteLine(Math.Max(Math.Max(A-B,A+B),A*B));

    }

    static long CountMP(List<long> L){
       long res = long.MaxValue;
       L.Sort();
       int p = 0;
       for(int i = p;i+2 < N;i++){
         if(Math.Abs(C-L[i]) < Math.Abs(C-L[i+1]) || i == N-3){
             res = Math.Abs(C-L[i]);
             p = i;
             break;
         }
       }
       
       for(int i = p+1;i+1< N;i++){
         if(Math.Abs(B-L[i]) < Math.Abs(B-L[i+1]) || i == N-2){
             res += Math.Abs(B-L[i]);
             p = i;
             break;
         }
       }
       
       for(int i = p+1;i< N;i++){
         if(i == N-1 || Math.Abs(A-L[i]) < Math.Abs(A-L[i+1])){
             res += Math.Abs(A-L[i]);
             break;
         }
       }
       return res;
    }

    static void SearchAll(List<long> Kadomatu,long MP = 0){
       var tmp = MP+CountMP(Kadomatu);
       if(tmp < ans){
          ans = tmp;
       }
       if(Kadomatu.Count() <= 3){
          return;
       }
       
       for(int i = 0;i < Kadomatu.Count();i++){
          for(int j = i+1;j < Kadomatu.Count();j++){
              Console.WriteLine();
             var list2 = new List<long>(Kadomatu);
             list2[j] += list2[i];
             list2.RemoveAt(i);
             SearchAll(list2,MP);
          }
       }
    }

}