| 
 | 
вернуться в форумthere are n * m possible sums. to find a solution, we can try to create such vectors such that all n * m sums are different. Suppose the 1st vector is 1 2 3 ... n   Then the first element of next vector is taken to be n + 1(we require all unique). Now we need to find the next element while making all n*p sums different, where p is the size of the 2nd vector.   n+1 1 2 3 ... n   initially all sums(n+2 to 2n+1) are distinct. Now we need to add new element such that smallest possible new sum is greater than the previous sum i.e. if new element is p p+1>2n+1 or p >= 2n + 1 in general p+1>prev+n p>=prev+n  |  
  | 
|