Problem Statement

A sport event is held in June of every year whose remainder when divided by $4$ is $2$.

Suppose that it is now January of the year $Y$. In what year will this sport event be held next time?

Constraints

  • $2000 \leq Y \leq 3000$
  • $Y$ is an integer.

Input

Input is given from Standard Input in the following format:

$Y$

Output

Print the answer.


Sample Input 1

2022

Sample Output 1

2022

The remainder when $2022$ is divided by $4$ is $2$, so if it is now January of $2022$, the next games will be held in June of the same year.


Sample Input 2

2023

Sample Output 2

2026

Sample Input 3

3000

Sample Output 3

3002

模拟即可。

#include<cstdio>
int y;
int main()
{
scanf("%d",&y);
if(y%4==3)
printf("%d",y+3);
else
printf("%d",y+(2-y%4));
}

[ABC262A] World Cup的更多相关文章

  1. java高cup占用解决方案

    项目中发现java cpu占用高达百分之四百,查看代码发现有一个线程在空转,拉高了cup while(true){ } 解决方案,循环中加入延迟:Thread.sleep(Time): 总结下排查CP ...

  2. UVALive 7147 World Cup(数学+贪心)(2014 Asia Shanghai Regional Contest)

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=6 ...

  3. uva 6757 Cup of Cowards(中途相遇法,貌似)

    uva 6757 Cup of CowardsCup of Cowards (CoC) is a role playing game that has 5 different characters (M ...

  4. 【转】关于KDD Cup '99 数据集的警告,希望从事相关工作的伙伴注意

    Features From: Terry Brugger Date: 15 Sep 2007 Subject: KDD Cup '99 dataset (Network Intrusion) cons ...

  5. Facebook Hacker Cup 2014 Qualification Round 竞赛试题 Square Detector 解题报告

    Facebook Hacker Cup 2014 Qualification Round比赛Square Detector题的解题报告.单击这里打开题目链接(国内访问需要那个,你懂的). 原题如下: ...

  6. DP VK Cup 2012 Qualification Round D. Palindrome pairs

    题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 /* 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 ...

  7. [BZOJ 3145][Feyat cup 1.5]Str 解题报告

    [Feyat cup 1.5]Str DescriptionArcueid,白姬,真祖的公主.在和推倒贵看电影时突然对一个问题产生了兴趣:我们都知道真祖和死徒是有类似的地方.那么从现代科学的角度如何解 ...

  8. HDU 2289 CUP 二分

    Cup Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  9. VK Cup 2012 Round 3 (Unofficial Div. 2 Edition)

    VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) 代码 VK Cup 2012 Round 3 (Unofficial Div. 2 Edition) A ...

  10. UVALive 7275 Dice Cup (水题)

    Dice Cup 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/D Description In many table-top ...

随机推荐

  1. Linux虚拟机报错Job for network.service failed because the control process exited with error codeLinux虚拟机报错的解决方法

    发布于 2 天前  3 次阅读 Linux虚拟机设置静态ip后,突然发现联网连不上了,ssh也无法使用,重启network后仍旧无法使用.按照网络上的方法发现没有效果后,右键如下位置将nat模式转换为 ...

  2. Azure Storage 系列(八)存储类型细化分类说明

    一,引言 Azure 存储账户功能经过官方改进迭代后,在创建的时候,存储账户的类型被分为两大类: 1)general-purpose v2 account(标准常规用途v2) Blob 存储,队列存储 ...

  3. 为什么创建 Redis 集群时会自动错开主从节点?

    哈喽大家好,我是咸鱼 在<一台服务器上部署 Redis 伪集群>这篇文章中,咸鱼在创建 Redis 集群时并没有明确指定哪个 Redis 实例将担任 master,哪个将担任 slave ...

  4. 有Root与无Root安装git-lfs

    有Root与无Root安装git-lfs 直接安装 先查看arm还是AMD 例如当前使用Rocky Linux 8.8版本的内核.因此,应该下载适用于Rocky Linux 8.x的Git LFS安装 ...

  5. 什么是IP协议?

    简介: IP(Internet Protocol)协议,又称网际协议,是TCP/IP协议的核心.它负责Internet上网络之间的通信,并规定了将数据报从一个网络传输到另一个网络所应遵循的规则.具体来 ...

  6. Elasticsearch整合SpringBoot案例

    1.elasticsearch官方文档的使用与介绍 1.1.Rest客户端初始化官方文档链接: https://www.elastic.co/guide/en/elasticsearch/client ...

  7. Solution -「NOI 2007」货币兑换

    Description Link. 一共 \(n\) 天,每天可以卖出或者买入两种股票 \(A\) 和 \(B\).这两种股票在第 \(i\) 天的价值为 \(A_i\) 和 \(B_i\). 每天可 ...

  8. 【python爬虫】爬虫所需要的爬虫代理ip是什么?

    前言 在进行爬虫程序开发时,经常会遇到访问被限制的网站,这时就需要使用代理 IP 来进行访问.本文将介绍代理 IP 的概念及使用方法,帮助读者更好地应对爬虫程序中的访问限制问题.同时,本文还将提供一些 ...

  9. “&”控制命令的运行方式

    在Unix.Linux和类Unix系统中,& 符号有特定的意义,用于控制命令的运行方式.具体来说,& 在命令末尾使用时表示将该命令放入后台运行. 前台运行: 如果你在终端输入一个命令, ...

  10. Python使用socket的UDP协议实现FTP文件服务

    简介 本示例主要是用Python的socket,使用UDP协议实现一个FTP服务端.FTP客户端,用来实现文件的传输.在公司内网下,可以不适用U盘的情况下,纯粹使用网络,来实现文件服务器的搭建,进而实 ...