I have got the solution for the given test cases but the hidden test cases are not getting passed i.e, getting a wrong answer. Can you please tell me a case where this approach fails.
The code is as follows:
for _ in range(int(input())):
a,b=map(int,input().split())
if(a>=2):
print(b*"")
for i in range(a-2):
if(b-2>0):
print(""+(b-2)"."+"")
else:
print("")
print(b"")
print()
else:
print(b"*")