//reference: http://blog.csdn.net/u012766950/article/details/38319843 #include #include #include using namespace std; bool compare(int a, int b) { return a > b; } int main() { int n = 0, tmp = 0; vector tian; vector king; while (cin >> n&&n) { int count = 0; for (int i = 0; i < n; i++) { cin >> tmp; tian.push_back(tmp); } for (int i = 0; i < n; i++) { cin >> tmp; king.push_back(tmp); } sort(tian.begin(), tian.end()); sort(king.begin(), king.end()); for (; (tian.size());) { int size = tian.size(); if (tian.at(size - 1) > king.at(size - 1)) { count++; tian.erase(tian.begin() + size - 1); king.erase(king.begin() + size - 1); } else if (tian.at(size - 1) < king.at(size - 1)) { count--; tian.erase(tian.begin()); king.erase(king.begin() + size - 1); } else if (tian.at(0) > king.at(0)) { count++; tian.erase(tian.begin()); king.erase(king.begin()); } else if (tian.at(0) < king.at(0)) { count--; tian.erase(tian.begin()); king.erase(king.begin() + size - 1); } else { if (tian.at(0) < king.at(size - 1)) { count--; } tian.erase(tian.begin()); king.erase(king.begin() + size - 1); } } cout << 200 * count << endl; tian.clear(); king.clear(); } return 0; }