class Permutiple { public: stringisPossible(int x){ string xx = std::to_string(x); do { int val = std::stoi(xx); if (val <= x) continue; if (val % x == 0) return"Possible"; } while (std::next_permutation(xx.begin(), xx.end())); return"Impossible"; } }
class ConstructLCSEasy { public: stringconstruct(int ab, int bc, int ca){ stringAB(ab, '1'); string BC = AB, CA = AB; int diff2 = bc - ab; while (diff2--) { BC += "0"; CA += "0"; } int diff3 = ca - ab; while (diff3--) { AB += "1"; CA += "1"; } return AB + " " + BC + " " + CA; } }