if remainder 1 or 2. In case of remainder 2 , we divide elements from 3 to n in groups of size 4 and put 1 in one group and 2 in group . This also makes difference 1.
if ( n % 4 == 1 n % 4 == 2 ) { Console . WriteLine ( " First ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Second ▁ " + " subset ▁ sum ▁ = ▁ " + ( ( s / 2 ) + 1 ) ) ; Console . WriteLine ( " Difference " + " ▁ = ▁ " + 1 ) ; }