简单题
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int main()
{
//freopen("t.txt", "r", stdin);
int t;
scanf("%d", &t);
while (t--)
{
int year, month, day, hour, minute, second;
scanf("%d/%d/%d-%d:%d:%d", &year, &month, &day, &hour, &minute, &second);
printf("%02d/%02d/%04d-%02d:%02d:%02d%s\n", month, day, year, (hour - 1 + 12) % 12 + 1, minute, second, hour >= 12 ? "pm" : "am");
}
return 0;
}