Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Probelm29
- {
- class Program
- {
- static void Main(string[] args)
- {
- int t = int.Parse(Console.ReadLine());
- for (int i = 0; i < t; i++)
- {
- string[] tab = Console.ReadLine().Split(' ');
- int a = int.Parse(tab[0]);
- int b = int.Parse(tab[1]);
- if(a < b)
- {
- int tmp = a;
- a = b;
- b = tmp;
- }
- int s = 2 * a;
- float T = 1 + (float)a / (float)b;
- Console.WriteLine(Math.Round(s/T));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement