import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines nums = np.array(read().split(), np.float64)[1:] np.sqrt(nums, out=nums) integer = nums.astype(np.int64) frac = nums - integer np.cumsum(integer, out=integer) k = np.searchsorted(integer, 2 ** 20) frac_1, frac_2 = np.divmod(frac[:k], 0.5 ** 20) np.cumsum(frac_1, out=frac_1) np.cumsum(frac_2, out=frac_2) frac[:k] = frac_1 * (0.5 ** 20) + frac_2 if 0