N people have to sit at a round table,each one representing a company. There are given K pairs of people who belong to competitive companies. Print all the possibilities for those people to sit at the table,so that two people from competitive companies won't stay next to one another.
I don't know how to start. To read those N people,I know it's
for(i=1;i<=n;i++) cin>>a[i];
But for those K? Because some of those N can have more competitive people(e.g. a[1] might be competitive with a[3] as well as with a[4]),whereas some of them can have no competitive.