Problem link: http://www.codechef.com/problems/RRMTRX2 I am not getting the below lines of problem Consider every possible vector v of m elements, such that every 1 ≤ vi ≤ n. Let value of the vector be product of all Avi, i (1 ≤ i ≤ m). You are to count the sum of values over all possible vectors v. What is vi ??and how vi changes when i changes?? How to choose Avi,i ?? Can i choose numbers from same position multiple times??. So these things i am not getting?? I think problem is given in weird form.Plz help asked 22 Dec '14, 15:01

here vi is the ith element of a vector 'v'. The vector consists of 'm' elements, each of which can be chosen from the numbers: 1,2,3....,n. Now, consider the ordered pairs: (vi,i) for all i belonging to [1,m]. This means that the ordered pairs are: (v1,1), (v2,2), (v3,3), (v4,4)... and so on. Now, the value of any vector is the product of all A(vi,i) where (vi,i) can be any of the ordered pairs described above. answered 24 Dec '14, 18:46

write down the sum of each columns(dont calculate the value ,just write a(i,j)+a(i+1,j)...) and multiply all the sums and see all the terms you get you will automatically understand answered 22 Dec '14, 15:26
