#include #include using namespace std; int main() { int w, h, x, y, z, maxval; string s; cin >> s; if (s != "P3") { cerr << s << ": not supported\n"; exit(1); } cout << s << "\n"; cin >> w >> h; cout << w << " " << h << "\n"; cin >> maxval; int d = 1; while (maxval / d > 255) d *= 2; cout << maxval / d << "\n"; for (int i = 0; i < w * h; i++) { cin >> x >> y >> z; cout << x / d << " " << y / d << " " << z / d << "\n"; } }