Greetings dev. peers, how is this even possible ? (quick quiz)

Revision en1, by Frenzy_Love, 2023-10-26 18:00:40

/* for l = 8, r = 26 */

include

include

include

include

using namespace std; using L = long; using LL = long long;

int main() {

int t;
cin >> t;

while (t--) {

    LL l, r;
    cin >> l >> r;

     LL res = (r >= 2 * l) ? (r - 1) / 2 : (r - l);

    cout << res << endl;
 }

return 0;

} /* how it is so that the answer is not 18 but 12!??? thanks, */

Tags 800, div.2, translation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Frenzy_Love 2023-10-26 18:00:40 566 Initial revision (published)