How to solve this modulo related problem ? 
Difference between en1 and en2, changed 108 character(s)
Given three arrays a,b,c all of same length N. You want to minimize the value of :↵

max( (a(i)+t)%k + (b(i)+t)%k + (c(i)+t)%k ) , for all 1<=i<=n .↵



where 't' can be any non-negative integer.↵

Input : Three arrays of size 'N' and an integer 'k'. How to find a 't' which can minimize this value ? ↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English LovesProgramming 2020-03-27 01:17:20 108
en1 English LovesProgramming 2020-03-27 01:15:22 246 Initial revision (published)