LOOK.....POTENTIAL ENERGY WILL BE
divided into 6 cases...
4 between the all four charges placed and two between the diagonals....
ok........
therefore
U1(for four charges)= 4kq2/D
U2(FOR TWO DIAGONAL CHARGES)=2kq
2/

2 D......
ADD THEM AS POTENTIAL ENERGY IS.....
SCALAR QUANTITY......
HOPE u have understood................
DON.........