{"problem":{"name":"One Three Nine","description":{"content":"You are given positive integers $N$ and $M$. Let us call a sequence of pairs of integers $((X_1,Y_1),(X_2,Y_2),\\dots,(X_K,Y_K))$ **wonderful** when it satisfies the following. *   $1 \\le X_i \\le N$ *","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc139_c"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $N$ and $M$.\nLet us call a sequence of pairs of integers $((X_1,Y_1),(X_2,Y_2),\\dots,(X_K,Y_K))$ **wonderful** when it satisfies the following.\n\n*   $1 \\le X_i \\le N$\n*   $1 \\le Y_i \\le M$\n*   $X_i+3Y_i \\neq X_j+3Y_j$ and $3X_i+Y_i \\neq 3X_j+Y_j$, if $i \\neq j$.\n\nMake a wonderful sequence of pairs of integers whose length, $K$, is the maximum possible.\n\n## Constraints\n\n*   $1 \\le N,M \\le 10^5$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc139_c","tags":[],"sample_group":[["3 4","10\n1 1\n1 2\n1 3\n2 1\n2 2\n2 3\n3 1\n3 2\n3 3\n3 4\n\nFor $N=3, M=4$, there is no wonderful sequence of pairs of integers whose length is $11$ or longer, and the above sequence of pairs of integers is wonderful, so this output is valid."]],"created_at":"2026-03-03 11:01:13"}}