1381 Coins game

topic:

There is a simple but very interesting game. There was a table has a coin in this game, there are many parallel lines (shown below) of this table. The distance between two adjacent parallel lines is 1, the radius of the coin is R, then we have to flip a coin on the table, and after throwing a coin sometimes intersected by a number (in the case of tangential intersection can be considered), there is time will not.

You toss a coin to calculate after the coins and straight lines intersect the desired number.



Input
The first line gives an integer T, T represents a group of data have (1 <= T <= 10000 ). 
Line 2 to T + 1, each row of a given integer R. (0 <R <= 10,000,000,000)
Output
For each data output line in answer to the integer part.

The number of coins of radius r intersects a straight line and have 2 * r 2 * r + 1, in which case only one of 2r + 1, coins and straight lines, this situation is only one, the coins fall the situation on the table there are numerous species, so the probability is zero, so the probability of another case is 1, so the answer is 2 * r


[cpp]  view plain  copy
 print ?
  1. #include <iostream>  
  2. #include<bits/stdc++.h>  
  3.   
  4. using namespace std;  
  5.   
  6. int  main ()  
  7. {  
  8.     int T;  
  9.     scanf("%d",&T);  
  10.     while(T--)  
  11.     {  
  12.         int r;  
  13.         scanf("%d",&r);  
  14.         cout<<r*2<<endl;  
  15.     }  
  16. }  
Published 29 original articles · won praise 3 · Views 3193

Guess you like

Origin blog.csdn.net/qq_38436175/article/details/78469543