Let the first number be a
Second number = a - 5
According to question,
a ( a - 5) = 14
=> a^2 - 5a = 14
=> a^2 - 5a - 14 = 0
=> a^2 - 7a + 2a - 14 = 0
=> a(a-7) + 2(a-7) = 0
=> (a-7) (a+2) = 0
a = 7 and - 2
Neglecting negative value, we get
a = 7
First number = 7
Second number = 2
Now,
Difference of their cubes = ( 7)^3 - (2)^3
= 343 - 8
= 335
this is the simple method hope it helps