博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Round 56-A. Dice Rolling(思维题)
阅读量:5077 次
发布时间:2019-06-12

本文共 2192 字,大约阅读时间需要 7 分钟。

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Mishka got a six-faced dice. It has integer numbers from 22 to 77 written on its faces (all numbers on faces are different, so this is an almostusual dice).

Mishka wants to get exactly xx points by rolling his dice. The number of points is just a sum of numbers written at the topmost face of the dice for all the rolls Mishka makes.

Mishka doesn't really care about the number of rolls, so he just wants to know any number of rolls he can make to be able to get exactly xxpoints for them. Mishka is very lucky, so if the probability to get xx points with chosen number of rolls is non-zero, he will be able to roll the dice in such a way. Your task is to print this number. It is guaranteed that at least one answer exists.

Mishka is also very curious about different number of points to score so you have to answer tt independent queries.

Input

The first line of the input contains one integer tt (1≤t≤1001≤t≤100) — the number of queries.

Each of the next tt lines contains one integer each. The ii-th line contains one integer xixi (2≤xi≤1002≤xi≤100) — the number of points Mishka wants to get.

Output

Print tt lines. In the ii-th line print the answer to the ii-th query (i.e. any number of rolls Mishka can make to be able to get exactly xixi points for them). It is guaranteed that at least one answer exists.

Example

input

Copy

421337100

output

Copy

13827

Note

In the first query Mishka can roll a dice once and get 22 points.

In the second query Mishka can roll a dice 33 times and get points 55, 55 and 33 (for example).

In the third query Mishka can roll a dice 88 times and get 55 points 77 times and 22 points with the remaining roll.

In the fourth query Mishka can roll a dice 2727 times and get 22 points 1111 times, 33 points 66 times and 66 points 1010 times.

每次都是两道,唉,何时才能提高啊

题解:把每次都看成2即可,感觉有点水

代码:

#include
#include
#include
#include
using namespace std;int main(){ int n; cin>>n; int k; for(int t=0;t
>k; cout<

 

转载于:https://www.cnblogs.com/Staceyacm/p/10781923.html

你可能感兴趣的文章
查询消除重复行
查看>>
Win 10 文件浏览器无法打开
查看>>
HDU 1212 Big Number(C++ 大数取模)(java 大数类运用)
查看>>
-bash: xx: command not found 在有yum源情况下处理
查看>>
[leetcode]Minimum Path Sum
查看>>
内存管理 浅析 内存管理/内存优化技巧
查看>>
hiho1079 线段树区间改动离散化
查看>>
【BZOJ 5222】[Lydsy2017省队十连测]怪题
查看>>
第二次作业
查看>>
【input】 失去焦点时 显示默认值 focus blur ★★★★★
查看>>
Java跟Javac,package与import
查看>>
day-12 python实现简单线性回归和多元线性回归算法
查看>>
Json格式的字符串转换为正常显示的日期格式
查看>>
[转]使用 Razor 进行递归操作
查看>>
[转]Android xxx is not translated in yyy, zzz 的解决方法
查看>>
docker入门
查看>>
Android系统--输入系统(十一)Reader线程_简单处理
查看>>
监督学习模型分类 生成模型vs判别模型 概率模型vs非概率模型 参数模型vs非参数模型...
查看>>
Mobiscroll脚本破解,去除Trial和注册时间限制【转】
查看>>
实验五 Java网络编程及安全
查看>>