input_array = np.empty((0, 2)) n = int(input()) for i in range(n): input_array = np.vstack([input_array, np.array(list(map(float, input().split(" "))))]) m = 5*(10**6) j = np.array([np.arange(-m//2, m//2)]*n) x_plus = j.T + input_array[:, 0] sin = np.sin(x_plus) / x_plus sin_sum = np.sum(sin, axis=0) res = np.dot(sin_sum, input_array[:, 1]) print(res)