ICPC-2 Code: Z15 Loss/death of partner problem