10 m 5 dm 2 cm 4 mm=10524 mm
1 2m 7 dm 5cm 2mm=12752 mm
The greatest length required is G.C.F of 10524 and 12752
Using Euclid algorithm
12752=10524×1+2228
10524=2228×4+1612
2228=1612×1+616
1612=616×2+380
616=380×1+236
380=236×1+144
236=144×1+92
144=92×1+52
92=52×1+40
52=40×1+12
40=12×3+4
12=4×3+0
Hence G.C.F =4mm