The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
A hyperplane in N dimensions can be represented by the following equation:
a1x1 + a2x2 + ... + aNxN + aN+1 = 0
Your task is to calculate the intersection point of N hyperplanes. It is guaranteed that the provided hyperplanes intersect at a unique point.
Â
Â
The first line of the input contains an integer N denoting the number of hyperplanes. The following N lines describe the coefficients a1 to aN of the hyperplanes, and the jth number in the ith line denotes coefficient aj of the ith hyperplane.
The next line contains the integer Q, the number of problem instances to solve. Each of the next Q lines contains N integers, where the ith integer denotes the coefficient aN+1 of the ith hyperplane.
Â
Â
Output N integers per line for each of the Q instances, which denote the coordinates of the intersection point of the hyperplanes, i.e. x1 to xN. Output the coordinates modulo 1000000007.
Â
Â
Â
Input: 3 1 2 1 4 3 2 5 0 6 2 4 5 2 3 1 0 Output: 920000007 840000004 400000002 760000007 520000002 200000000 Explanation: After substituting the values of x1 to xN in the equation, you will find that the sum is 0 modulo
1000000007.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll