How to solve this modulo related problem ?

Revision en2, by LovesProgramming, 2020-03-27 01:17:20

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 ?

Tags #modular_theory

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)