WA=1 TLE=2 MLE=3 OLE=4 RE=5 r=(No Yes) read while read -aa;do read -ab read x y=${!x} z=0 : $[i={1..5},z|=i==y?a[i]:b[i]] echo ${r[!z]} done