#include <iostream>
#include <new>
int main() {
int m = 3;
int *chunk = new int[m *2];
int **arr = new int*[m];
for (int i = 0; i < m; i++)
arr[i] = new (chunk + i * 2) int[2];
delete[] arr;
delete[] chunk;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bmV3PgoKaW50IG1haW4oKSB7CgoJaW50IG0gPSAzOwoJCglpbnQgKmNodW5rID0gbmV3IGludFttICoyXTsKCWludCAqKmFyciA9IG5ldyBpbnQqW21dOwoJCglmb3IgKGludCBpID0gMDsgaSA8IG07IGkrKykKCQlhcnJbaV0gPSBuZXcgKGNodW5rICsgaSAqIDIpIGludFsyXTsKCgoJZGVsZXRlW10gYXJyOwoJZGVsZXRlW10gY2h1bms7CgoJcmV0dXJuIDA7Cn0=