/* * File: main.cpp * Author: Josh * * Created on October 13, 2012, 2:47 PM */ #include <cstdlib> #include <iostream> using namespace std; int cases; int tests; int n; int position[4]; int result; int handle_case(){ int resultat; double slope; if(position[0] == position[2] && position[1] == position[3]){ resultat = 0; }else if(abs(position[0] + position[1] - position[2] - position[3]) % 2 == 0){ slope = (double)(position[0] - position[2]) / (position[1] - position[3]); if(slope == 1 || slope == -1) resultat = 1; else resultat = 2; }else{ resultat = -1; } return resultat; } void get_tests_size(){ cin >> tests; cin >> n; } int main(int argc, char** argv) { cin >> cases; for(int case_ = 0; case_ < cases; case_ ++){ get_tests_size(); for(int test = 0; test < tests; test ++){ for(int i = 0; i < 4; i ++) cin >> position[i]; result = handle_case(); if(result != -1) cout << result << endl; else cout << "no move" << endl; } } return 0; }The statements and opinions included in these pages are those of only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
© 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Isaac Traxler