{"problem":{"name":"Patisserie ABC 2","description":{"content":"Takahashi, a pastry chef at _ABC Confiserie_, has decided to make cakes to celebrate AtCoder Beginner Contest 200. A cake made by Takahashi has three parameters: _beauty_, _taste_, and _popularity_, e","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc200_e"},"statements":[{"statement_type":"Markdown","content":"Takahashi, a pastry chef at _ABC Confiserie_, has decided to make cakes to celebrate AtCoder Beginner Contest 200.\nA cake made by Takahashi has three parameters: _beauty_, _taste_, and _popularity_, each of which is represented by an integer between $1$ and $N$ (inclusive).\nHe has made a cake of beauty $i$, taste $j$, and popularity $k$ for every triple $(i,j,k)\\ (1 \\le i,j,k \\le N)$.  \nThen, he has arranged these $N^3$ cakes in a row, as follows:\n\n*   The cakes are in ascending order of sum of beauty, taste, and popularity from left to right.\n*   For two cakes with the same sum of beauty, taste, and popularity, the cake with the smaller beauty is to the left.\n*   For two cakes with the same sum and the same beauty, the cake with the smaller taste is to the left.\n\nFind the beauty, taste, and popularity of the $K$\\-th cake from the left.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\le N \\le 10^6$\n*   $1 \\le K \\le N^3$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc200_e","tags":[],"sample_group":[["2 5","1 2 2\n\nThe cakes are in the following order:\n$(1,1,1),(1,1,2),(1,2,1),(2,1,1),(1,2,2),(2,1,2),(2,2,1),(2,2,2)$.\nHere, each triple of integers represents the beauty, taste, and popularity of a cake."],["1000000 1000000000000000000","1000000 1000000 1000000\n\nThe values in input may be large."],["9 47","3 1 4"]],"created_at":"2026-03-03 11:01:14"}}