A. 24 Game

链接:https://codeforces.com/problemset/problem/468/A

Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.

Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a and b, erase them from the sequence, and append to the sequence either a + b, or a - b, or a × b.

After n - 1 steps there is only one number left. Can you make this number equal to 24?

Input

The first line contains a single integer n (1 ≤ n ≤ 105).

Output

If it's possible, print "YES" in the first line. Otherwise, print "NO" (without the quotes).

If there is a way to obtain 24 as the result number, in the following n - 1 lines print the required operations an operation per line. Each operation should be in form: "a op b = c". Where a and b are the numbers you've picked at this operation; op is either "+", or "-", or "*"; cis the result of corresponding operation. Note, that the absolute value of c mustn't be greater than 1018. The result of the last operation must be equal to 24. Separate operator sign and equality sign from numbers with spaces.

If there are multiple valid answers, you may print any of them.

Examples

input

Copy

1

output

Copy

NO

input

Copy

8

output

Copy

YES
8 * 7 = 56
6 * 5 = 30
3 - 4 = -1
1 - 2 = -1
30 - -1 = 31
56 - 31 = 25
25 + -1 = 24
#include<bits/stdc++.h>
using namespace std;
long long n,t,l,j,r,k,d,ans,max1=0,mod=1e9+7;
long long a[200005],b[200005];
map<long long,long long>m;
int main()
{
	cin>>n;
	if(n<4)
	cout<<"NO";
	else
	{
		if(n%2==0)
		{
			cout<<"YES"<<endl;
			for(int i=n;i>4;i=i-2)
			{
				cout<<i<<" - "<<i-1<<" = 1"<<endl;
			}
			cout<<"4 * 3 = 12"<<endl;
			cout<<"1 * 2 = 2"<<endl; 
			for(int i=1;i<(n-4)/2;i++)
			{
				cout<<1<<" * "<<1<<" = 1"<<endl;
			}
			if(n!=4)
			cout<<"1 * 12 = 12"<<endl;
			cout<<"12 * 2 = 24"<<endl; 
		}
		else
		{
			cout<<"YES"<<endl;
			for(int i=n;i>5;i=i-2)
			{
				cout<<i<<" - "<<i-1<<" = 1"<<endl;
			}
			cout<<"5 - 2 = 3"<<endl;
			cout<<"3 - 1 = 2"<<endl;
			cout<<"3 * 4 = 12"<<endl; 
			for(int i=1;i<(n-5)/2;i++)
			{
				cout<<1<<" * "<<1<<" = 1"<<endl;
			}
			if(n!=5)
			cout<<"1 * 2 = 2"<<endl;
			cout<<"2 * 12 = 24"<<endl;
		}
	} 
	
} 

 

[2025.08.14-09.24.22:957][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.22:973][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.22:990][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:007][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:024][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:040][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:057][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:074][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:090][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:106][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:124][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:140][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:157][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:173][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:190][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:207][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:223][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:240][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:257][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:274][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:290][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:307][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:324][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:340][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:357][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:373][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:390][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:407][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:425][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:440][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:457][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:474][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:490][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:506][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:524][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:540][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:557][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:574][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:590][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:607][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:624][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:640][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:657][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:674][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:690][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:706][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:723][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:740][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:757][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:773][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:790][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:808][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:824][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:840][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:856][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:874][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:890][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:907][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:924][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:940][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:957][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:973][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.23:990][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:007][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:025][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:040][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:057][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:073][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:090][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:107][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:124][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:140][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:157][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:173][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:190][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:206][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:223][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:240][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:257][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:257][142]LogSlate: Window '转换项目' being destroyed [2025.08.14-09.24.24:277][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:278][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:298][142]LogSlate: Took 0.000090 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Light.ttf' (167K) [2025.08.14-09.24.24:353][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:354][142]LogLinux: Could not get DPI information for monitor #0, assuming 1.0f [2025.08.14-09.24.24:393][142]Running /home/lixing/UnrealEngine-4.27/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="/home/lixing/catkin_ws/src/AirSim/Unreal/Environments/Blocks/Blocks.uproject" -game -engine -progress [2025.08.14-09.24.24:494][142] [2025.08.14-09.24.24:494][142]Running Mono... [2025.08.14-09.24.24:494][142] [2025.08.14-09.24.24:795][142]Fixing inconsistent case in filenames. [2025.08.14-09.24.24:795][142]Setting up Mono [2025.08.14-09.24.24:795][142]~/UnrealEngine-4.27/Engine ~/UnrealEngine-4.27/Engine/Binaries/Linux [2025.08.14-09.24.25:099][142]Discovering modules, targets and source code for project... [2025.08.14-09.24.29:823][142]Generating data for project indexing... [2025.08.14-09.24.43:226][142]Generating data for project indexing... 9% [2025.08.14-09.24.56:006][142]Generating data for project indexing... 66% [2025.08.14-09.25.08:989][142]Generating data for project indexing... 83% [2025.08.14-09.25.21:862][142]Generating data for project indexing... 95% [2025.08.14-09.25.23:673][142]WARNING: Library 'stdc++' was not resolvable to a file when used in Module 'AirSim', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning. [2025.08.14-09.25.23:673][142]WARNING: Library 'supc++' was not resolvable to a file when used in Module 'AirSim', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning. [2025.08.14-09.25.25:782][142]Generating data for project indexing... 100% [2025.08.14-09.25.25:782][142]Discovering modules, targets and source code for project... [2025.08.14-09.25.27:988][142]Generating data for project indexing... [2025.08.14-09.25.44:995][142]Generating data for project indexing... 5%
最新发布
08-15
这些日志信息看起来是来自一个基于Unreal Engine(虚幻引擎)的应用程序或项目的运行输出,可能是在Linux环境下运行的。以下是一些关键信息的解读: 1. **DPI信息警告**: ``` LogLinux: Could not get DPI information for monitor #0, assuming 1.0f ``` 这条信息表明程序无法获取显示器的DPI(每英寸点数)设置,因此假设使用默认的DPI缩放比例(1.0)。这通常与图形界面或窗口管理相关,可能是由于系统环境或某些图形库未正确配置导致的。 2. **窗口被销毁**: ``` LogSlate: Window '转换项目' being destroyed ``` 这条信息表示名为“转换项目”的窗口正在被销毁。这可能发生在程序关闭或重新加载界面时。 3. **字体加载**: ``` LogSlate: Took 0.000090 seconds to synchronously load lazily loaded font ``` 这条信息表示程序同步加载了一个字体文件(Roboto-Light.ttf),用时0.000090秒。 4. **UnrealBuildTool运行**: ``` Running /home/lixing/UnrealEngine-4.27/Engine/Binaries/DotNET/UnrealBuildTool.exe ``` 这表明UnrealBuildTool(虚幻引擎构建工具)正在运行,用于生成项目文件,可能是在为项目生成Visual Studio或其他IDE的项目文件以便于开发。 5. **模块和源代码索引生成**: ``` Discovering modules, targets and source code for project... Generating data for project indexing... ``` UnrealBuildTool 正在分析项目中的模块、目标和源代码,并生成索引数据,这通常是为了支持IDE(如Visual Studio)的代码导航和智能提示功能。 6. **依赖库警告**: ``` WARNING: Library 'stdc++' was not resolvable to a file... ``` 这些警告表明模块“AirSim”引用了系统库(如`stdc++`和`supc++`),但未明确指定完整路径。虽然程序仍然可以运行,但建议明确指定路径以避免性能问题和依赖检查失效。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值