First we will subtract 5 and 7 from 101 and 115 recpectively.
Now, we have 101 − 5 = 96 and 115 − 7 = 108
96 = 2 × 2 × 2 × 2 × 2 × 3 = 25 × 31
108 =2 × 2 × 3 × 3 × 3 = 22 × 33
HCF of 96 and 108= 22 × 31 = 12
Hence, the greatest number that can divide 101 and 115 leaving remainders 5 and 7 respectively is 12.