#include #define DOWN 1 #define LEFT 2 int map[100][100]; int w, h; int count = 0; void check(int x, int y, int from, int curved) { if(x == h - 1 && y == w - 1) //オフィスへ到着 { count++; return; } if(x >= h || y >= w) //経路でない場合 { return; } if(curved) { switch(from) { case DOWN: check(x, y + 1, DOWN, 0); break; case LEFT: check(x + 1, y, LEFT, 0); break; } } else { switch(from) { case DOWN: check(x, y + 1, DOWN, 0); check(x + 1, y, LEFT, 1); break; case LEFT: check(x, y + 1, DOWN, 1); check(x + 1, y, LEFT, 0); } } return; } int main(void) { scanf("%d %d", &w, &h); //右方向に出発 check(1, 0, LEFT, 0); //上方向に出発 check(0, 1, DOWN, 0); printf("%d", count % 100000); return 0; }