import json

# Read two JSON files using relative paths
with open('./data/result/gsm8k_input350.json', 'r', encoding='utf-8') as f1:
    data1 = json.load(f1)

with open('./data/result/gsm8k_input500.json', 'r', encoding='utf-8') as f2:
    data2 = json.load(f2)

# Merge two lists
merged_data = data1 + data2

# Write the results to a new file
with open('./data/result/gsm8k_0_500.json', 'w', encoding='utf-8') as out:
    json.dump(merged_data, out, ensure_ascii=False, indent=4)