1440cm
LCM of 48, 72 is 144cm, i.e. for each 144cm there will be one footprint overlapped.
let z=周長
no of footprint made by 小飛=z/48
no of footprint made by 爺爺=z/72
no of footprint overlapped = z/144
since total visible footprint=40
then , z/48+z/72-z/144=40
(3z+2z-z)/144=40
4z/144=40
z=1440