Problem:
Score : 100 points

Problem Statement

You are given positive integers A and B.

If A is a divisor of B, print A + B; otherwise, print B - A.

Constraints

All values in input are integers.

1 \leq A \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

If A is a divisor of B, print A + B; otherwise, print B - A.

Sample Input 1

4 12

Sample Output 1

16

As 4 is a divisor of 12, 4 + 12 = 16 should be printed.

Sample Input 2

8 20

Sample Output 2

12

Sample Input 3

1 1

Sample Output 3

2

1 is a divisor of 1.

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;


namespace practice1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] a = s.Split(' ');
            int x, y;
            x = int.Parse(a[0]);
            y = int.Parse(a[1]);

            if (y % x == 0)
            {
                Console.WriteLine(x + y);
            }

            else
            {
                Console.WriteLine(y - x);
            }
        }
    }

    

    class MYCP
    {
        //int変数を標準出力する
        public static void Print_Int(long number)
        {
            Console.WriteLine("" + number);
        }

        //int変数の配列を標準出力する
        public static void Print_Ints(int[] a)
        {
            if (a.Length == 0) return;

            Console.Write(a[0]);

            for(int i = 1; i < a.Length; i++)
            {
                Console.Write(" ");
                Console.Write(a[i]);
            }

            Console.WriteLine();
        }


        //文字列を配列化して返す
        public static string[] MyReadLineSplit()
        {
            return Console.ReadLine().Split();
        }

        //指定された個数分int変数を読み取る
        public static int[] Read_Ints(long number)
        {
            int[] a = new int[number];
            string[] buff = MyReadLineSplit();
            for (long i = 0; i < number; i++)
            {
                a[i] = int.Parse(buff[i]);
            }

            return a;
        }

        //指定された個数分BigInteger変数を読み取る
        public static BigInteger[] Read_BigIntegers(long number)
        {
            BigInteger[] a = new BigInteger[number];
            string[] buff = MyReadLineSplit();
            for(long i = 0; i < number; i++)
            {
                a[i] = BigInteger.Parse(buff[i]);
            }

            return a;
        }



        //渡された自然数が素数か判定する。素数ならtrueを返す。
        public static bool PrimeCheck_Int(int number)
        {
            if (number < 2) return false;

            for(int i = 2; i < number; i++)
            {
                if (number % i == 0) return false;
            }

            return true;
        }

        //渡された自然数が累乗数か判定する。累乗数ならtrueを返す。
        public static bool Bekizyousuu_Check_Int(int number)
        {
            if (number == 1) return true;

            int i, copy;


            for (i = 2; i < number; i++)
            {
                copy = number;
                while (copy % i == 0)
                {
                    copy /= i;
                }

                if (copy == 1) return true;
            }

            return false;
        }

        //BIgIntegerで累乗計算を行う
        public static BigInteger MyPower_BigInteger(BigInteger a,BigInteger b)
        {
            BigInteger i, x = 1;

            for (i = 0; i < b; i++)
            {
                x *= a;
            }

            return x;
        }

        //渡されたBigIntegerの配列の和を求める
        public static BigInteger MySum_BigInteger(BigInteger[] a)
        {
            BigInteger sum = 0;
            int i;

            for (i = 0; i < a.Length; i++)
            {
                sum += a[i];
            }

            return sum;

        }

        //aをN進法で表した時の各桁の総和を求める
        public static int SumKeta_Int(int a,int N_shinhou)
        {
            if (a <= 0) return 0;
            int sum = 0;

            while (a > 0)
            {
                sum += a % N_shinhou;
                a -= a % N_shinhou;
                a /= N_shinhou;

            }

            return sum;

        }

        //並び替えの通り数を求める
        public static BigInteger NPR_BigInteger(int n,int r)
        {
            BigInteger a = 1;
            for(int i = 0; i < r; i++)
            {
                a *= n;
                n--;
            }

            return a;

            
        }

        //組み合わせの通り数を求める
        public static BigInteger NCR_BigInteger(int n,int r)
        {
            BigInteger a = 1;
            for(int i = 0; i < r; i++)
            {
                a *= n;
                n--;
            }

            a /= NPR_BigInteger(r, r);

            return a;
        }
    }
}