{"problem":{"name":"PC on the Table","description":{"content":"> Planning to place many PCs in his room, Takahashi has decided to write a code that finds how many PCs he can place in his room. You are given $H$ strings $S_1,S_2,\\ldots,S_H$, each of length $W$, c","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc297_c"},"statements":[{"statement_type":"Markdown","content":"> Planning to place many PCs in his room, Takahashi has decided to write a code that finds how many PCs he can place in his room.\n\nYou are given $H$ strings $S_1,S_2,\\ldots,S_H$, each of length $W$, consisting of `.` and `T`.\nTakahashi may perform the following operation any number of times (possibly zero):\n\n*   Choose integers satisfying $1\\leq i \\leq H$ and $1 \\leq j \\leq W-1$ such that the $j$\\-th and $(j+1)$\\-th characters of $S_i$ are both `T`. Replace the $j$\\-th character of $S_i$ with `P`, and $(j+1)$\\-th with `C`.\n\nHe tries to maximize the number of times he performs the operation. Find possible resulting $S_1,S_2,\\ldots,S_H$.\n\n## Constraints\n\n*   $1\\leq H \\leq 100$\n*   $2\\leq W \\leq 100$\n*   $H$ and $W$ are integers.\n*   $S_i$ is a string of length $W$ consisting of `.` and `T`.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$H$ $W$ \n$S_1$\n$S_2$\n$\\vdots$\n$S_H$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc297_c","tags":[],"sample_group":[["2 3\nTTT\nT.T","PCT\nT.T\n\nHe can perform the operation at most once.\nFor example, an operation with $(i,j)=(1,1)$ makes $S_1$ `PCT`."],["3 5\nTTT..\n.TTT.\nTTTTT","PCT..\n.PCT.\nPCTPC"]],"created_at":"2026-03-03 11:01:14"}}