------
## 最终结论
```python
import itertools

def calculate(a, b, op):
    if op == '+':
        return a + b
    elif op == '-':
        return a - b
    elif op == '*':
        return a * b
    elif op == '/':
        if b != 0:
            return a / b
        else:
            return None

def dfs(nums):
    if len(nums) == 1:
        return abs(nums[0] - 24) < 1e-6
    
    for i in range(len(nums)):
        for j in range(len(nums)):
            if i != j:
                next_nums = [nums[k] for k in range(len(nums)) if k != i and k != j]
                for op in ['+', '-', '*', '/']:
                    result = calculate(nums[i], nums[j], op)
                    if result is not None:
                        next_nums.append(result)
                        if dfs(next_nums):
                            return True
                        next_nums.pop()
    return False

def can_get_24(cards):
    for perm in itertools.permutations(cards):
        if dfs(list(perm)):
            return True
            
    return False

# Example usage:
print(can_get_24([4, 1, 8, 7]))  # Output: True
print(can_get_24([1, 2, 1, 2]))  # Output: False
```