All three programs revolve around one rule: a name can be reused for a different variable if the new declaration sits in a nested inner scope, but the same name cannot be declared twice inside the same scope, no matter what type the second declaration uses.
Since P2 and P3 both break the same-scope redeclaration rule and only P1 uses a legal nested-scope shadow, only P1 compiles without error.
Let's summarize:
So the correct answer is option (A): only P1 compiles without error.