Here, mass of each star, `M=2xx10^(30)kg`
Initial potential between two stars, `r=10^(9)km=10^(12)m`
Initial potential energy of the system=`-GMm//r`
Total K.E. of the stars `=1//2MV^(2)+1//2Mv^(2)`
Where v is the speed of stars with which they collide when the stars are about to collide, the distance between their centres, r=2R.
`therefore` Final potential energy of two stars=GMm/2R
Since gain in K.E. is the cost of loss in PE