#include using namespace std; typedef long long ll; int main() { map roman={{'I',1},{'V',5},{'X',10},{'L',50},{'C',100},{'D',500},{'M',1000}}; pair toroman[]={{1000,"M"},{500,"D"},{400,"CD"},{100,"C"},{50,"L"},{40,"XL"},{10,"X"},{5,"V"},{4,"IV"},{1,"I"}}; int n; cin>>n; int sum=0; for (int i=0;i>a; for (int j=0;j3999) { puts("ERROR"); return 0; } string ans; for (auto p:toroman) { while (sum>=p.first) { sum-=p.first; ans+=p.second; } } cout<