/*
增伤测试
*/
#pragma GCC optimize(3)
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long LL;
const int N = 66, K = 15;
int n, m, k; //关数 能量总数 战术种数
double ans;
struct Node {
double w, gs, b, bs, gz, yc; //武装增伤 攻击速度 暴击率 暴击伤害 过载概率 远程伤害
int nl; //能量数
int cnt; //个数
double w_jc; // 基础增伤
double ans; //增伤值
}f[11][N][K], p[K];
int main() {
// 武装 攻速 暴击 暴伤 过载 远程 能量
p[++ k] = {0.00, 0.20, 0.01, 0.00, 0.08, 0.00, 355, 0}; // 狂战神
p[++ k] = {0.20, 0.00, 0.03, 0.00, 0.00, 0.20, 300, 0}; // 星陨
p[++ k] = {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 600, 0}; // 连射之心
p[++ k] = {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 650, 0}; // 速度爆发
p[++ k] = {0.00, 0.20, 0.02, 0.00, 0.00, 0.00, 200, 0}; // 传奇刷新
p[++ k] = {0.18, 0.18, 0.00, 0.00, 0.00, 0.00, 280, 0}; // 迅捷狂涛
p[++ k] = {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 500, 0}; // 致命暴击
p[++ k] = {0.08, 0.00, 0.00, 0.00, 0.12, 0.10, 300, 0}; // 星辰之失
p[++ k] = {0.00, 0.00, 0.15, 0.00, 0.00, 0.00, 000, 0}; // 杀戮之击
p[++ k] = {0.00, 0.30, 0.00, 0.00, 0.00, 0.00, 250, 0}; // 神行冲击
p[++ k] = {0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 300, 0}; // 神行雷霆
p[++ k] = {0.50, 0.00, 0.00, 0.00, 0.00, 0.00, 275, 0}; // 神行太保
printf("#n关: 狂 星 连 速 传 迅 致 星 杀 冲 雷 太\n");
for (n = 41; n <= 41; ++ n)
{
m = n * 500 - 320 * 6;
ans = 0;
for (p[1].cnt = 9 ; p[1].cnt <= 28; ++ p[1].cnt) // 狂战神
for (p[2].cnt = 5 ; p[2].cnt <= 9 ; ++ p[2].cnt) // 星陨
for (p[3].cnt = 0 ; p[3].cnt <= 0 ; ++ p[3].cnt) // 连射之心
for (p[4].cnt = 0 ; p[4].cnt <= 15; ++ p[4].cnt) // 速度爆发
for (p[5].cnt = 0 ; p[5].cnt <= 1 ; ++ p[5].cnt) // 传奇刷新
for (p[6].cnt = 0 ; p[6].cnt <= 0 ; ++ p[6].cnt) // 迅捷狂涛
for (p[7].cnt = 0 ; p[7].cnt <= 0 ; ++ p[7].cnt) // 致命暴击
for (p[8].cnt = 0 ; p[8].cnt <= 2 ; ++ p[8].cnt) // 星辰之失
for (p[9].cnt = 0 ; p[9].cnt <= 1 ; ++ p[9].cnt) // 杀戮之击
for (p[10].cnt = 0 ; p[10].cnt <= 0 ; ++ p[10].cnt) // 神行冲击
for (p[11].cnt = 0 ; p[11].cnt <= 0 ; ++ p[11].cnt) // 神行雷霆
for (p[12].cnt = 0 ; p[12].cnt <= 0 ; ++ p[12].cnt) // 神行太保
{
int mm = 0, kk = 0;
for (int u = 1; u <= k; ++ u) mm += p[u].cnt * p[u].nl, kk += p[u].cnt;
if (mm > m || kk > 42) continue;
double gs = 0, gs_sx = 0, b = 0, gz = 0, yc = 0, w = 0, w_jc = 0, w_sx = 0, bs = 0, bs_sx = 0;
// 攻击速度
for (int u = 1; u <= k - 3; ++ u) gs = min(5.0, gs + p[u].cnt * p[u].gs);
gs_sx = min(5.0, gs_sx + p[10].cnt * p[10].gs);
// 过载概率
for (int u = 1; u <= k - 3; ++ u) gz = min(4.0, gz + p[u].cnt * p[u].gz);
// 远程伤害
for (int u = 1; u <= k - 3; ++ u) yc = yc + p[u].cnt * p[u].yc;
// 暴击率
for (int u = 1; u <= k - 3; ++ u)
{
if (u != 9) b = min(b <= 0.45 ? 0.45 : b, b + p[u].cnt * p[u].b);
else b += min(0.15, p[u].cnt * p[u].b);
}
// 武装增伤
w += p[3].cnt * (int(gs * 100 / 5)) / 100.0;
for (int u = 1; u <= k - 3; ++ u) w += p[u].cnt * p[u].w;
w_jc = 7.58 * 1.2;
w_sx = p[12].cnt * p[12].w;
// 暴击伤害
bs += p[4].cnt * (gs / 2) + p[7].cnt * (int(b / 2 * 100) * 8 / 100.0);
for (int u = 1; u <= k - 3; ++ u) bs += p[u].cnt * p[u].bs;
bs_sx = p[11].cnt * p[11].bs;
// b = 1; // 百爆
double res = (1 + gz) * (w + w_jc + w_sx + yc) * (1 - b + b * (1.5 + (bs + bs_sx))) / (5 / (1 + min(5.0, gs + gs_sx)));
{
if (res > f[0][n][0].ans)
{
for (int i = 7; i > -1; -- i)
{
f[i][n][0].gs = i > 0 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 0 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 0 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 0 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 0 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 0 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 0 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 0 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 0 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[1][n][0].ans)
{
for (int i = 7; i > 0; -- i)
{
f[i][n][0].gs = i > 1 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 1 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 1 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 1 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 1 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 1 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 1 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 1 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 1 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[2][n][0].ans)
{
for (int i = 7; i > 1; -- i)
{
f[i][n][0].gs = i > 2 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 2 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 2 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 2 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 2 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 2 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 2 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 2 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 2 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[3][n][0].ans)
{
for (int i = 7; i > 2; -- i)
{
f[i][n][0].gs = i > 3 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 3 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 3 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 3 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 3 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 3 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 3 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 3 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 3 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[4][n][0].ans)
{
for (int i = 7; i > 3; -- i)
{
f[i][n][0].gs = i > 4 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 4 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 4 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 4 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 4 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 4 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 4 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 4 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 4 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[5][n][0].ans)
{
for (int i = 7; i > 4; -- i)
{
f[i][n][0].gs = i > 5 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 5 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 5 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 5 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 5 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 5 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 5 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 5 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 5 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[6][n][0].ans)
{
for (int i = 7; i > 5; -- i)
{
f[i][n][0].gs = i > 6 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 6 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 6 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 6 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 6 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 6 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 6 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 6 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 6 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
else if (res > f[7][n][0].ans)
{
for (int i = 7; i > 6; -- i)
{
f[i][n][0].gs = i > 7 ? f[i - 1][n][0].gs : gs;
f[i][n][0].gz = i > 7 ? f[i - 1][n][0].gz : gz;
f[i][n][0].yc = i > 7 ? f[i - 1][n][0].yc : yc;
f[i][n][0].b = i > 7 ? f[i - 1][n][0].b : b;
f[i][n][0].w = i > 7 ? f[i - 1][n][0].w : w;
f[i][n][0].w_jc = i > 7 ? f[i - 1][n][0].w_jc : w_jc;
f[i][n][0].bs = i > 7 ? f[i - 1][n][0].bs : bs;
f[i][n][0].ans = i > 7 ? f[i - 1][n][0].ans : res;
for (int u = 1; u <= k; ++ u) f[i][n][u].cnt = i > 7 ? f[i - 1][n][u].cnt : p[u].cnt;
}
}
}
}
printf("#%d关: \n", n);
for (int i = 0; i < 8; ++ i)
{
printf("方案%d:", i + 1);
for (int u = 1; u <= k; ++ u) printf("%02d ", f[i][n][u].cnt);
printf("基础武装%.2lf ", f[i][n][0].w_jc);
printf("加成武装%.2lf 暴伤%.2lf 暴击%.2lf 攻速%.2lf 过载%.2lf 远程%.2lf", f[i][n][0].w, f[i][n][0].bs, f[i][n][0].b, f[i][n][0].gs, f[i][n][0].gz, f[i][n][0].yc);
int mm = 0;
for (int u = 1; u <= k; ++ u) mm += f[i][n][u].cnt * p[u].nl;
printf("增伤值:%.3lf 剩余%d能量\n", f[i][n][0].ans, m - mm);
}
}
return 0;
}