General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
196498578 Practice:
bkifhr7
1800E2 - 31 PyPy 3-64 Accepted 436 ms 21368 KB 2023-03-08 14:45:44 2023-03-08 14:45:45
→ Source
t=int(input())
for i in range (t):
    n,k=map(int,input().split())
    s1=input();s2=input()
    if n<=k:
        print('YES' if s1==s2 else 'NO')
    else:
        i=n-k
        print("YES" if sorted(s1)==sorted(s2) and s1[i:-i] ==s2[i:-i] else "NO")
	  	  		  		  		 	  			   	   	
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details