I was trying to solve this problem from Egyptian ECPC but I couldn't. Can anyone give me a hint ?
someone who already solved said that he use disjoint set but I can't deal with it using disjoint set .
Problem related disjoint set and GCD.
I was trying to solve this problem from Egyptian ECPC but I couldn't. Can anyone give me a hint ?
someone who already solved said that he use disjoint set but I can't deal with it using disjoint set .