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

Правка en1, от 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, */

Теги 800, div.2, translation

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Frenzy_Love 2023-10-26 18:00:40 566 Initial revision (published)