fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main() {
  7. int n, a[100005], b;
  8. long long cnt;
  9. scanf("%d", &n);
  10. cnt=0;
  11. for(int i=0; i<n; i++) scanf("%d", &a[i]);
  12. for(int i=0; i<n; i++) {
  13. scanf("%d", &b);
  14. if(b>a[i]*2 || b<2) cnt--;
  15. else cnt+=pow(b, 2)/4;
  16. }
  17. printf("%lld\n", cnt);
  18. return 0;
  19. }
Success #stdin #stdout 0s 3612KB
stdin
1
1000000
1000000
stdout
250000000000