using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); string[] nums; double numer, denomi; var dic = new Dictionary(); for (int i = 0; i < n; i++) { nums = Console.ReadLine().Split(' '); numer = double.Parse(nums[0]); denomi = double.Parse(nums[1]); var format = string.Format("{0} {1}", numer, denomi); dic.Add(numer / denomi, format); } foreach (var data in dic.OrderByDescending(x => x.Key)) { Console.WriteLine(data.Value); } } } }