ADITYA AND GEET CHAOS
CodeChefOpen on judge ↗
Aditya has $N$ nodes and $N$-$1$ Edges with no cycles(nodes are a permutation of N). He wants Geet to find the product of xor of nodes in subtree of ’$A$’ and ‘and’ of nodes in subtree of ’$B$’($A$ > $B$ ) such that the GCD($A$ ^ $B$ , $A$ & $B$ ) is Maximum where product of $A$ and $B$ is Minimum. Here ‘$A$’ and ‘$B$’ are two nodes($A$ and $B$ represents nodes as well as the nodes value). Note
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start