Ehab and the Expected XOR Problem

CodeForces - 1174D