Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace mainSolution
- {
- static class Program
- {
- static int autoSum(int n)
- {
- return ((n + n * n) / 2);
- }
- static void Main(string[] args)
- {
- int m = Int32.Parse(Console.ReadLine());
- int k = Int32.Parse(Console.ReadLine());
- Console.WriteLine(autoSum(m) + autoSum(2 * k));
- }
- }
- }
Add Comment
Please, Sign In to add comment