Skip to content

Instantly share code, notes, and snippets.

@jongha
Created July 29, 2019 00:50
Show Gist options
  • Save jongha/42a396dbe70354c0935e17bbb55bf092 to your computer and use it in GitHub Desktop.
Save jongha/42a396dbe70354c0935e17bbb55bf092 to your computer and use it in GitHub Desktop.
UVa 11311 - Exclusively Edible
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <list>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
using namespace std;
int main(void) {
while(true) {
int c;
int ret = scanf("%d", &c);
if(ret == EOF) break;
while(c--) {
int m, n, r, c;
scanf("%d %d %d %d", &m, &n, &r, &c);
if (r ^ c ^ (m - r - 1) ^ (n - c - 1)) printf("Gretel\n");
else printf("Hansel\n");
}
}
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment