using System.Linq; using System; public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var x = Array.ConvertAll(line, long.Parse); line = Console.ReadLine().Trim().Split(' '); var y = Array.ConvertAll(line, long.Parse); getAns(n, x, y); } static void getAns(int n, long[] x, long[] y) { var xy = new long[n]; for (int i = 0; i < n; i++) xy[i] = x[i] + y[i]; var xymin = xy.Min(); var ans = new long[n]; if (xymin == 0) goto next; for (int i = 0; i < n; i++) { ans[i] = x[i] * xymin / xy[i]; } next:; Console.WriteLine(xymin); Console.WriteLine(0); Console.WriteLine(string.Join("\n", ans)); Console.WriteLine(xymin); } }