複数の時計の同時を計算するアルゴリズム

最近プログラムの試合に使われた問題を解こうとしています。ジャンルは数学と検索だと思います。
Basically, given a group of clocks for which the rate of each is known, compute the earliest time when all are in synch (minute hand only). Rates are given as number of minutes each clock moves in an hour.
Note that if all other clocks' hands are in synch with the fastest clock's hand, then all hands are in synch.
My strategy was to consider the fastest clock (largest rate). When all clocks have their minute hands in synch, the total number of minutes which have elapsed according to the fastest clock will be m. Take any other clock and call the number of minutes which have elapsed according to it n. If the minute hands of an analog clock are in synch, then m%60 == n%60, where m%60 is m minus the largest integral multiple of 60 less than or equal to m. Let x be the number of minutes which have passed in "absolute" time. Let r1 be the rate of the fastest clock and r2 the rate of some other clock. Then the minutes of the fastest clock are r1*x/60. For (r1*x/60 - r2*x/60)%60 = 0 to hold (necessary for the clocks to be in sync), r1-r2 must be a multiple of 3600. The earliest time when the clocks are in synch is when r1-r2 is 3600. Then total minutes at this point will be (in fastest watch terms):
(3600/(r1-r2))*watch[len-1]/60 = 60*watch[len-1]/(r1-r2)
watch[len-1] is the rate of the fastest watch (assuming ascending order sort).
Now consider all pairings of the fastest watch and others. In each case, 60*watch[len-1] will be minutes when pair of watches are in sync for the (r1-ri)th time. So we know that 60*watch[len] is a time when all are in sync. However, if all rate differences r1-ri share a common divisor, we should divide by this to obtain the first time all are in sync(e.g. if differences are 4 and 6, we divide 60*watch[len-1] by 2 to obtain the time when one pair is in sync for the second time and the other pair is in sync for the third time).
Adding a %60 to obtain minutes past the hour, we have
(60*watch[len-1]/gcd)%60