Triplet with no element divisible by 3 and sum N | Java program to print a , b and c such that a + b + c = N ; Function to print a , b and c ; check if n - 2 is divisible by 3 or not ; Driver Code
class GFG { static void printCombination ( int n ) { System . out . print ( 1 + " ▁ " ) ; if ( ( n - 2 ) % 3 == 0 ) System . out . print ( 2 + " ▁ " + ( n - 3 ) ) ; else System . out . print ( 1 + " ▁ " + ( n - 2 ) ) ; } public static void main ( String [ ] args ) { int n = 233 ; printCombination ( n ) ; } }