SP22271 PERIOD3 - Periodic function, trip 3

Description

Solar cycle predictions are used by various agencies and many industry groups. The solar cycle is important for determining the lifetime of satellites in low-Earth orbit, as the drag on the satellites correlates with the solar cycle \[...\]. [(NOAA)](http://www.swpc.noaa.gov/products/solar-cycle-progression) ![400 Years of Sunspot Observation](https://www.spoj.com/content/francky:Sun400 "400 Years of Sunspot Observation")[(Solar Cycle)](http://en.wikipedia.org/wiki/Solar_cycle) Sunspot Number Progression : Observed data through May 2008 ; Dec 2012 ; Nov 2014 ![Pred-2008](https://www.spoj.com/content/francky:Sun2008)![Pred-2012](https://www.spoj.com/content/francky:Sun2012)![Pred-2014](https://www.spoj.com/content/francky:Sun2014) goal of the problem is to propose a perfect prediction center, with weak constraints. Let us consider periodic functions from **Z** to **R**.

Input Format

On the first line, you will be given an integer _N_. On the second line, you will be given integers _y_ : the first (0-indexed) _N×N_ values of a periodic function _f_ that is sum of periodic functions all with as period an integer _N_ at maximum. On the third line, you will be given _N×N_ integers _x_.

Output Format

Print _f(x)_ for all required _x_. See sample for details.