注意到1,2,3都是无解。。。4,5,6,7都有解,如果n大于8,可以通过凑对使得n降到4-7里面。。所以肯定就能构造出一组解使得n>=4的时候算到24点。。。
#include <iostream>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <time.h>
#define maxn 100005
#define maxm 300005
#define eps 1e-10
#define mod 10000007
#define INF 1e9
#define lowbit(x) (x&(-x))
#define mp make_pair
#define ls o<<1
#define rs o<<1 | 1
#define lson o<<1, L, mid
#define rson o<<1 | 1, mid+1, R
typedef long long LL;
//typedef int LL;
using namespace std;
LL qpow(LL a, LL b){LL res=1,base=a;while(b){if(b%2)res=res*base;base=base*base;b/=2;}return res;}
LL powmod(LL a, LL b){LL res=1,base=a;while(b){if(b%2)res=res*base%mod;base=base*base%mod;b/=2;}return res;}
void scanf(int &__x){__x=0;char __ch=getchar();while(__ch==' '||__ch=='\n')__ch=getchar();while(__ch>='0'&&__ch<='9')__x=__x*10+__ch-'0',__ch = getchar();}
LL gcd(LL _a, LL _b){if(!_b) return _a;else return gcd(_b, _a%_b);}
// head
int n;
void work(void)
{
if(n == 1 || n == 2 || n == 3) {
printf("NO\n");
return;
}
printf("YES\n");
while(n >= 8) {
printf("%d - %d = 1\n", n, n-1);
printf("%d - %d = 1\n", n-2, n-3);
printf("1 - 1 = 0\n");
printf("1 + 0 = 1\n");
n -= 4;
}
if(n == 4) {
printf("1 * 2 = 2\n");
printf("2 * 3 = 6\n");
printf("6 * 4 = 24\n");
}
if(n == 5) {
printf("4 * 5 = 20\n");
printf("20 + 3 = 23\n");
printf("23 + 2 = 25\n");
printf("25 - 1 = 24\n");
}
if(n == 6) {
printf("4 * 6 = 24\n");
printf("24 + 5 = 29\n");
printf("29 - 2 = 27\n");
printf("27 - 3 = 24\n");
printf("24 * 1 = 24\n");
}
if(n == 7) {
printf("7 + 6 = 13\n");
printf("13 + 5 = 18\n");
printf("18 + 4 = 22\n");
printf("22 + 3 = 25\n");
printf("2 - 1 = 1\n");
printf("25 - 1 = 24\n");
}
}
int main(void)
{
scanf("%d", &n);
work();
return 0;
}