fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin>>t;
  8. while(t--)
  9. {
  10. int x,y;
  11. cin>>x>>y;
  12. int p=500-(2*x);
  13. int k=1000-((x+y)*4);
  14. cout<<(p+k)<<endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5312KB
stdin
4
10 20
8 40
15 15
20 10
stdout
1360
1292
1350
1340