// A simple simulated question requires a comprehensive and accurate simulation of every sub-rule, which is easy to miss! # Include <iostream> # include <cmath> # include <string> using namespace STD; int main () {int TC, X, Y; string pos1, pos2; cin> TC; while (TC --) {CIN> pos1> pos2; X = ABS (float (pos1 [0]-48) -(pos2 [0]-48); y = ABS (float (pos1 [1]-48)-(pos2 [1]-48 ))); if (x = 0 & Y = 0) // when the start position is the same as the end position, cout <0 <"<0 <" "<0 <0 <" <0 <Endl; else {// Number of master steps if (x <Y) cout <Y <""; else cout <X <""; // subsequent steps if (x = Y | x = 0 | Y = 0) cout <1 <""; else cout <2 <"; // number of vehicle steps if (x = 0 | Y = 0) cout <1 <""; else cout <2 <""; // Number of elephant steps if (ABS (x-y) % 2! = 0) cout <"inf" <Endl; else if (x = y) cout <1 <Endl; else cout <2 <Endl ;}} system ("pause ");}