#CCBCHBAHAI0000054. Hai danh sách - tích tương ứng và căn tổng (Two Lists - Pairwise Products and Square Root of the Sum)

Hai danh sách - tích tương ứng và căn tổng (Two Lists - Pairwise Products and Square Root of the Sum)

Two Lists - Pairwise Products and Square Root of the Sum (Hai danh sách - tích tương ứng và căn tổng)

Source: Problem Solving and Program Design in C

Version: Phuoc Hung OJ Extended

Problem

Given two non-negative integer sequences

$$x_0,x_1,\ldots,x_{n-1}\quad\text{and}\quad y_0,y_1,\ldots,y_{n-1},$$

define

zi=xiyi,z_i=x_i y_i,

and

S=∑i=0n−1zi,R=S.S=\sum_{i=0}^{n-1}z_i,\qquad R=\sqrt{S}.

For every index, print xi,yi,zix_i,y_i,z_i, then print RR with exactly 66 digits after the decimal point.

Input

The first line contains nn. The second line contains xix_i. The third line contains yiy_i.

Output

For each ii, print x_i y_i z_i on its own line. On the last line, print RR with exactly 6 digits after the decimal point.

Subtask

Subtask 1 (20 points): 1≤n≤51\le n\le5, 0≤xi,yi≤1000\le x_i,y_i\le100.

Subtask 2 (30 points): 1≤n≤101\le n\le10, 0≤xi,yi≤1040\le x_i,y_i\le10^4.

Subtask 3 (50 points): 1≤n≤201\le n\le20, 0≤xi,yi≤1060\le x_i,y_i\le10^6.

Example

Input

4
1 2 3 4
5 6 7 8

Output

1 5 5
2 6 12
3 7 21
4 8 32
8.366600

Explanation

The sample follows the definitions and rules above.