Implement a function named find_permutations_for_condition that takes a list of test cases, where each test case consists of an integer and a list of integers. The function should return results based on specific conditions regarding the permutations of integers in the lists provided.
Functionality:
For each test case, determine if it is possible to rearrange the integers in such a way that no integer appears more than half of the total number of integers (n).
If the maximum frequency of any integer in the list exceeds n // 2 or if there are 2 or fewer unique integers in the list, the function should return "NO" for that test case.
If the conditions are met, the function should return "YES" along with two permutations:
The original sorted list
A shifted version of the list where the first half is moved to the end of the list.
Input/Output Requirements:
Input: A list of tuples test_cases, where each tuple contains:
An integer n (the length of the list)
A list l of n integers
Output: A list of results for each test case, where each result is:
The function must be implemented in a file named /app/solution.py. Make sure to handle different scenarios for input validation and permutation generation based on the outlined conditions.