General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
197834936 Practice:
cxhscst2
1800E2 - 31 PyPy 3 Accepted 514 ms 12024 KB 2023-03-18 00:47:40 2023-03-18 00:47:40
→ Source
for _ in range(int(input())):
    n, k = map(int, input().split())
    s = input()
    t = input()
    
    if n <= k:
        print("YES" if s == t else "NO")
        continue

    p = n - k

    print("YES" if sorted(s) == sorted(t) and s[p:-p] == t[p:-p] else "NO")
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details