Describe AKnight'sJourney here
Source Code ¶
#include <stdio.h> int main() { int n, p, q; int i; scanf("%d", &n); for(i=1; i<=n; i++){ scanf("%d %d", &p, &q); printf("Scenario #%d:\n", i); switch(p*10+q){ case 11: puts("A1"); break; case 34: puts("A1C2A3B1D2B3C1A2C3D1B2D3"); break; case 37: puts("A1B3D2F1G3E2G1F3E1G2E3C2A3B1C3A2C1D3B2D1F2"); break; case 38: puts("A1B3C1A2C3D1B2D3E1G2E3C2A3B1D2F1H2F3G1E2G3H1F2H3"); break; case 43: puts("A1B3C1A2B4C2A3B1C3A4B2C4"); break; case 45: puts("A1B3C1A2B4D3E1C2D4E2C3A4B2D1E3C4A3B1D2E4"); break; case 46: puts("A1B3C1A2B4C2D4E2F4D3E1F3D2B1A3C4B2A4C3E4F2D1E3F1"); break; case 54: puts("A1B3A5C4D2B1A3B5D4C2B4A2C1D3C5A4B2D1C3D5"); break; case 55: puts("A1B3A5C4A3B1D2E4C5A4B2D1C3B5D4E2C1A2B4D5E3C2E1D3E5"); break; case 64: puts("A1B3A5C6D4B5D6C4D2B1A3C2B4A2C1D3B2D1C3D5B6A4C5A6"); break; case 73: puts("A1B3C1A2C3B1A3C2B4A6C7B5A7C6A5B7C5A4B2C4B6"); break; case 83: puts("A1B3C1A2B4C2A3B1C3A4B2C4A5B7C5A6B8C6A7B5C7A8B6C8"); break; default: puts("impossible"); } puts(""); } return 0; }
/// WA C