Skip to content

Instantly share code, notes, and snippets.

@sugyan
Last active January 2, 2023 12:17
Show Gist options
  • Save sugyan/0ebe2536dd2f987d3be10a617c5e7c0c to your computer and use it in GitHub Desktop.
Save sugyan/0ebe2536dd2f987d3be10a617c5e7c0c to your computer and use it in GitHub Desktop.
use std::fmt::{Display, Formatter, Result, Write};
#[derive(Clone, Copy, PartialEq, Eq)]
enum Op {
Add,
Sub,
Mul,
Div,
}
impl Display for Op {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.write_char(match self {
Self::Add => '+',
Self::Sub => '-',
Self::Mul => '*',
Self::Div => '/',
})
}
}
struct Frac {
n: i32,
d: i32,
}
impl Frac {
fn apply(&self, op: &Op, rhs: &Self) -> Option<Self> {
match op {
Op::Add => Some(Self {
n: self.n * rhs.d + rhs.n * self.d,
d: self.d * rhs.d,
}),
Op::Sub => Some(Self {
n: self.n * rhs.d - rhs.n * self.d,
d: self.d * rhs.d,
}),
Op::Mul => Some(Self {
n: self.n * rhs.n,
d: self.d * rhs.d,
}),
Op::Div if rhs.n != 0 => Some(Self {
n: self.n * rhs.d,
d: self.d * rhs.n,
}),
_ => None,
}
}
}
impl From<i32> for Frac {
fn from(value: i32) -> Self {
Self { n: value, d: 1 }
}
}
struct Solution {
target: i32,
}
impl Solution {
const NUMS: [i32; 10] = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1];
fn search(
&self,
stack: &mut Vec<Frac>,
ops: &mut Vec<Option<Op>>,
i: usize,
found: &mut Vec<Vec<Option<Op>>>,
) {
if i == Self::NUMS.len() && stack.len() == 1 {
if stack[0].d * self.target == stack[0].n {
found.push(ops.clone());
}
return;
}
if let Some(&f) = Self::NUMS.get(i) {
stack.push(f.into());
ops.push(None);
self.search(stack, ops, i + 1, found);
ops.pop();
stack.pop();
}
if stack.len() > 1 {
let f0 = stack.pop().unwrap();
let f1 = stack.pop().unwrap();
for op in &[Op::Add, Op::Sub, Op::Mul, Op::Div] {
if let Some(f) = f1.apply(op, &f0) {
stack.push(f);
ops.push(Some(*op));
self.search(stack, ops, i, found);
ops.pop();
stack.pop();
}
}
stack.push(f1);
stack.push(f0);
}
}
fn filter(ops: &&Vec<Option<Op>>) -> bool {
let mut v = vec![
false, false, false, false, false, false, false, false, true, false,
];
let mut stack = Vec::new();
for op in ops.iter() {
if let Some(o) = op {
if let (Some(b0), Some(b1)) = (stack.pop(), stack.pop()) {
if b1 {
return o == &Op::Div;
}
stack.push(b0 | b1);
}
} else if let Some(b) = v.pop() {
stack.push(b);
}
}
unreachable!()
}
fn solve(&self) {
let mut candidates = Vec::new();
self.search(&mut Vec::new(), &mut Vec::new(), 0, &mut candidates);
for answer in candidates.iter().filter(Self::filter) {
let mut stack = Vec::new();
let mut nums = Self::NUMS
.iter()
.rev()
.map(|&n| n.to_string())
.collect::<Vec<_>>();
for o in answer {
if let Some(op) = o {
if let (Some(s0), Some(s1)) = (stack.pop(), stack.pop()) {
stack.push(format!("({}{}{})", s1, op, s0));
}
} else if let Some(s) = nums.pop() {
stack.push(s);
}
}
if let Some(mut s) = stack.pop() {
if s.contains("9/8") {
s += " !";
}
println!("{s}");
}
}
}
}
fn main() {
Solution { target: 2023 }.solve();
}
((10*(9/((8-7)/(6*(5/(4/3))))))-(2*1))
((10*(9/((8-7)/(6*(5/(4/3))))))-(2/1))
(((10*(9/((8-7)/(6*(5/(4/3))))))-2)*1)
(((10*(9/((8-7)/(6*(5/(4/3))))))-2)/1)
((10*(9/((8-7)/(6*((5/4)*3)))))-(2*1))
((10*(9/((8-7)/(6*((5/4)*3)))))-(2/1))
(((10*(9/((8-7)/(6*((5/4)*3)))))-2)*1)
(((10*(9/((8-7)/(6*((5/4)*3)))))-2)/1)
((10*(9/((8-7)/((6*(5/4))*3))))-(2*1))
((10*(9/((8-7)/((6*(5/4))*3))))-(2/1))
(((10*(9/((8-7)/((6*(5/4))*3))))-2)*1)
(((10*(9/((8-7)/((6*(5/4))*3))))-2)/1)
((10*(9/(((8-7)/(6*(5/4)))/3)))-(2*1))
((10*(9/(((8-7)/(6*(5/4)))/3)))-(2/1))
(((10*(9/(((8-7)/(6*(5/4)))/3)))-2)*1)
(((10*(9/(((8-7)/(6*(5/4)))/3)))-2)/1)
((10*((9/((8-7)/(6*(5/4))))*3))-(2*1))
((10*((9/((8-7)/(6*(5/4))))*3))-(2/1))
(((10*((9/((8-7)/(6*(5/4))))*3))-2)*1)
(((10*((9/((8-7)/(6*(5/4))))*3))-2)/1)
(((10*(9/((8-7)/(6*(5/4)))))*3)-(2*1))
(((10*(9/((8-7)/(6*(5/4)))))*3)-(2/1))
((((10*(9/((8-7)/(6*(5/4)))))*3)-2)*1)
((((10*(9/((8-7)/(6*(5/4)))))*3)-2)/1)
((10*(9/((8-7)/((6*5)/(4/3)))))-(2*1))
((10*(9/((8-7)/((6*5)/(4/3)))))-(2/1))
(((10*(9/((8-7)/((6*5)/(4/3)))))-2)*1)
(((10*(9/((8-7)/((6*5)/(4/3)))))-2)/1)
((10*(9/((8-7)/(((6*5)/4)*3))))-(2*1))
((10*(9/((8-7)/(((6*5)/4)*3))))-(2/1))
(((10*(9/((8-7)/(((6*5)/4)*3))))-2)*1)
(((10*(9/((8-7)/(((6*5)/4)*3))))-2)/1)
((10*(9/(((8-7)/((6*5)/4))/3)))-(2*1))
((10*(9/(((8-7)/((6*5)/4))/3)))-(2/1))
(((10*(9/(((8-7)/((6*5)/4))/3)))-2)*1)
(((10*(9/(((8-7)/((6*5)/4))/3)))-2)/1)
((10*((9/((8-7)/((6*5)/4)))*3))-(2*1))
((10*((9/((8-7)/((6*5)/4)))*3))-(2/1))
(((10*((9/((8-7)/((6*5)/4)))*3))-2)*1)
(((10*((9/((8-7)/((6*5)/4)))*3))-2)/1)
(((10*(9/((8-7)/((6*5)/4))))*3)-(2*1))
(((10*(9/((8-7)/((6*5)/4))))*3)-(2/1))
((((10*(9/((8-7)/((6*5)/4))))*3)-2)*1)
((((10*(9/((8-7)/((6*5)/4))))*3)-2)/1)
((10*(9/(((8-7)/(6*5))*(4/3))))-(2*1))
((10*(9/(((8-7)/(6*5))*(4/3))))-(2/1))
(((10*(9/(((8-7)/(6*5))*(4/3))))-2)*1)
(((10*(9/(((8-7)/(6*5))*(4/3))))-2)/1)
((10*(9/((((8-7)/(6*5))*4)/3)))-(2*1))
((10*(9/((((8-7)/(6*5))*4)/3)))-(2/1))
(((10*(9/((((8-7)/(6*5))*4)/3)))-2)*1)
(((10*(9/((((8-7)/(6*5))*4)/3)))-2)/1)
((10*((9/(((8-7)/(6*5))*4))*3))-(2*1))
((10*((9/(((8-7)/(6*5))*4))*3))-(2/1))
(((10*((9/(((8-7)/(6*5))*4))*3))-2)*1)
(((10*((9/(((8-7)/(6*5))*4))*3))-2)/1)
(((10*(9/(((8-7)/(6*5))*4)))*3)-(2*1))
(((10*(9/(((8-7)/(6*5))*4)))*3)-(2/1))
((((10*(9/(((8-7)/(6*5))*4)))*3)-2)*1)
((((10*(9/(((8-7)/(6*5))*4)))*3)-2)/1)
((10*((9/((8-7)/(6*5)))/(4/3)))-(2*1))
((10*((9/((8-7)/(6*5)))/(4/3)))-(2/1))
(((10*((9/((8-7)/(6*5)))/(4/3)))-2)*1)
(((10*((9/((8-7)/(6*5)))/(4/3)))-2)/1)
((10*(((9/((8-7)/(6*5)))/4)*3))-(2*1))
((10*(((9/((8-7)/(6*5)))/4)*3))-(2/1))
(((10*(((9/((8-7)/(6*5)))/4)*3))-2)*1)
(((10*(((9/((8-7)/(6*5)))/4)*3))-2)/1)
(((10*((9/((8-7)/(6*5)))/4))*3)-(2*1))
(((10*((9/((8-7)/(6*5)))/4))*3)-(2/1))
((((10*((9/((8-7)/(6*5)))/4))*3)-2)*1)
((((10*((9/((8-7)/(6*5)))/4))*3)-2)/1)
(((10*(9/((8-7)/(6*5))))/(4/3))-(2*1))
(((10*(9/((8-7)/(6*5))))/(4/3))-(2/1))
((((10*(9/((8-7)/(6*5))))/(4/3))-2)*1)
((((10*(9/((8-7)/(6*5))))/(4/3))-2)/1)
((((10*(9/((8-7)/(6*5))))/4)*3)-(2*1))
((((10*(9/((8-7)/(6*5))))/4)*3)-(2/1))
(((((10*(9/((8-7)/(6*5))))/4)*3)-2)*1)
(((((10*(9/((8-7)/(6*5))))/4)*3)-2)/1)
((10*(9/(((8-7)/6)/(5/(4/3)))))-(2*1))
((10*(9/(((8-7)/6)/(5/(4/3)))))-(2/1))
(((10*(9/(((8-7)/6)/(5/(4/3)))))-2)*1)
(((10*(9/(((8-7)/6)/(5/(4/3)))))-2)/1)
((10*(9/(((8-7)/6)/((5/4)*3))))-(2*1))
((10*(9/(((8-7)/6)/((5/4)*3))))-(2/1))
(((10*(9/(((8-7)/6)/((5/4)*3))))-2)*1)
(((10*(9/(((8-7)/6)/((5/4)*3))))-2)/1)
((10*(9/((((8-7)/6)/(5/4))/3)))-(2*1))
((10*(9/((((8-7)/6)/(5/4))/3)))-(2/1))
(((10*(9/((((8-7)/6)/(5/4))/3)))-2)*1)
(((10*(9/((((8-7)/6)/(5/4))/3)))-2)/1)
((10*((9/(((8-7)/6)/(5/4)))*3))-(2*1))
((10*((9/(((8-7)/6)/(5/4)))*3))-(2/1))
(((10*((9/(((8-7)/6)/(5/4)))*3))-2)*1)
(((10*((9/(((8-7)/6)/(5/4)))*3))-2)/1)
(((10*(9/(((8-7)/6)/(5/4))))*3)-(2*1))
(((10*(9/(((8-7)/6)/(5/4))))*3)-(2/1))
((((10*(9/(((8-7)/6)/(5/4))))*3)-2)*1)
((((10*(9/(((8-7)/6)/(5/4))))*3)-2)/1)
((10*(9/((((8-7)/6)/5)*(4/3))))-(2*1))
((10*(9/((((8-7)/6)/5)*(4/3))))-(2/1))
(((10*(9/((((8-7)/6)/5)*(4/3))))-2)*1)
(((10*(9/((((8-7)/6)/5)*(4/3))))-2)/1)
((10*(9/(((((8-7)/6)/5)*4)/3)))-(2*1))
((10*(9/(((((8-7)/6)/5)*4)/3)))-(2/1))
(((10*(9/(((((8-7)/6)/5)*4)/3)))-2)*1)
(((10*(9/(((((8-7)/6)/5)*4)/3)))-2)/1)
((10*((9/((((8-7)/6)/5)*4))*3))-(2*1))
((10*((9/((((8-7)/6)/5)*4))*3))-(2/1))
(((10*((9/((((8-7)/6)/5)*4))*3))-2)*1)
(((10*((9/((((8-7)/6)/5)*4))*3))-2)/1)
(((10*(9/((((8-7)/6)/5)*4)))*3)-(2*1))
(((10*(9/((((8-7)/6)/5)*4)))*3)-(2/1))
((((10*(9/((((8-7)/6)/5)*4)))*3)-2)*1)
((((10*(9/((((8-7)/6)/5)*4)))*3)-2)/1)
((10*((9/(((8-7)/6)/5))/(4/3)))-(2*1))
((10*((9/(((8-7)/6)/5))/(4/3)))-(2/1))
(((10*((9/(((8-7)/6)/5))/(4/3)))-2)*1)
(((10*((9/(((8-7)/6)/5))/(4/3)))-2)/1)
((10*(((9/(((8-7)/6)/5))/4)*3))-(2*1))
((10*(((9/(((8-7)/6)/5))/4)*3))-(2/1))
(((10*(((9/(((8-7)/6)/5))/4)*3))-2)*1)
(((10*(((9/(((8-7)/6)/5))/4)*3))-2)/1)
(((10*((9/(((8-7)/6)/5))/4))*3)-(2*1))
(((10*((9/(((8-7)/6)/5))/4))*3)-(2/1))
((((10*((9/(((8-7)/6)/5))/4))*3)-2)*1)
((((10*((9/(((8-7)/6)/5))/4))*3)-2)/1)
(((10*(9/(((8-7)/6)/5)))/(4/3))-(2*1))
(((10*(9/(((8-7)/6)/5)))/(4/3))-(2/1))
((((10*(9/(((8-7)/6)/5)))/(4/3))-2)*1)
((((10*(9/(((8-7)/6)/5)))/(4/3))-2)/1)
((((10*(9/(((8-7)/6)/5)))/4)*3)-(2*1))
((((10*(9/(((8-7)/6)/5)))/4)*3)-(2/1))
(((((10*(9/(((8-7)/6)/5)))/4)*3)-2)*1)
(((((10*(9/(((8-7)/6)/5)))/4)*3)-2)/1)
((10*((9/((8-7)/6))*(5/(4/3))))-(2*1))
((10*((9/((8-7)/6))*(5/(4/3))))-(2/1))
(((10*((9/((8-7)/6))*(5/(4/3))))-2)*1)
(((10*((9/((8-7)/6))*(5/(4/3))))-2)/1)
((10*((9/((8-7)/6))*((5/4)*3)))-(2*1))
((10*((9/((8-7)/6))*((5/4)*3)))-(2/1))
(((10*((9/((8-7)/6))*((5/4)*3)))-2)*1)
(((10*((9/((8-7)/6))*((5/4)*3)))-2)/1)
((10*(((9/((8-7)/6))*(5/4))*3))-(2*1))
((10*(((9/((8-7)/6))*(5/4))*3))-(2/1))
(((10*(((9/((8-7)/6))*(5/4))*3))-2)*1)
(((10*(((9/((8-7)/6))*(5/4))*3))-2)/1)
(((10*((9/((8-7)/6))*(5/4)))*3)-(2*1))
(((10*((9/((8-7)/6))*(5/4)))*3)-(2/1))
((((10*((9/((8-7)/6))*(5/4)))*3)-2)*1)
((((10*((9/((8-7)/6))*(5/4)))*3)-2)/1)
((10*(((9/((8-7)/6))*5)/(4/3)))-(2*1))
((10*(((9/((8-7)/6))*5)/(4/3)))-(2/1))
(((10*(((9/((8-7)/6))*5)/(4/3)))-2)*1)
(((10*(((9/((8-7)/6))*5)/(4/3)))-2)/1)
((10*((((9/((8-7)/6))*5)/4)*3))-(2*1))
((10*((((9/((8-7)/6))*5)/4)*3))-(2/1))
(((10*((((9/((8-7)/6))*5)/4)*3))-2)*1)
(((10*((((9/((8-7)/6))*5)/4)*3))-2)/1)
(((10*(((9/((8-7)/6))*5)/4))*3)-(2*1))
(((10*(((9/((8-7)/6))*5)/4))*3)-(2/1))
((((10*(((9/((8-7)/6))*5)/4))*3)-2)*1)
((((10*(((9/((8-7)/6))*5)/4))*3)-2)/1)
(((10*((9/((8-7)/6))*5))/(4/3))-(2*1))
(((10*((9/((8-7)/6))*5))/(4/3))-(2/1))
((((10*((9/((8-7)/6))*5))/(4/3))-2)*1)
((((10*((9/((8-7)/6))*5))/(4/3))-2)/1)
((((10*((9/((8-7)/6))*5))/4)*3)-(2*1))
((((10*((9/((8-7)/6))*5))/4)*3)-(2/1))
(((((10*((9/((8-7)/6))*5))/4)*3)-2)*1)
(((((10*((9/((8-7)/6))*5))/4)*3)-2)/1)
(((10*(9/((8-7)/6)))*(5/(4/3)))-(2*1))
(((10*(9/((8-7)/6)))*(5/(4/3)))-(2/1))
((((10*(9/((8-7)/6)))*(5/(4/3)))-2)*1)
((((10*(9/((8-7)/6)))*(5/(4/3)))-2)/1)
(((10*(9/((8-7)/6)))*((5/4)*3))-(2*1))
(((10*(9/((8-7)/6)))*((5/4)*3))-(2/1))
((((10*(9/((8-7)/6)))*((5/4)*3))-2)*1)
((((10*(9/((8-7)/6)))*((5/4)*3))-2)/1)
((((10*(9/((8-7)/6)))*(5/4))*3)-(2*1))
((((10*(9/((8-7)/6)))*(5/4))*3)-(2/1))
(((((10*(9/((8-7)/6)))*(5/4))*3)-2)*1)
(((((10*(9/((8-7)/6)))*(5/4))*3)-2)/1)
((((10*(9/((8-7)/6)))*5)/(4/3))-(2*1))
((((10*(9/((8-7)/6)))*5)/(4/3))-(2/1))
(((((10*(9/((8-7)/6)))*5)/(4/3))-2)*1)
(((((10*(9/((8-7)/6)))*5)/(4/3))-2)/1)
(((((10*(9/((8-7)/6)))*5)/4)*3)-(2*1))
(((((10*(9/((8-7)/6)))*5)/4)*3)-(2/1))
((((((10*(9/((8-7)/6)))*5)/4)*3)-2)*1)
((((((10*(9/((8-7)/6)))*5)/4)*3)-2)/1)
((10*((9/(8-7))*(6*(5/(4/3)))))-(2*1))
((10*((9/(8-7))*(6*(5/(4/3)))))-(2/1))
(((10*((9/(8-7))*(6*(5/(4/3)))))-2)*1)
(((10*((9/(8-7))*(6*(5/(4/3)))))-2)/1)
((10*((9/(8-7))*(6*((5/4)*3))))-(2*1))
((10*((9/(8-7))*(6*((5/4)*3))))-(2/1))
(((10*((9/(8-7))*(6*((5/4)*3))))-2)*1)
(((10*((9/(8-7))*(6*((5/4)*3))))-2)/1)
((10*((9/(8-7))*((6*(5/4))*3)))-(2*1))
((10*((9/(8-7))*((6*(5/4))*3)))-(2/1))
(((10*((9/(8-7))*((6*(5/4))*3)))-2)*1)
(((10*((9/(8-7))*((6*(5/4))*3)))-2)/1)
((10*(((9/(8-7))*(6*(5/4)))*3))-(2*1))
((10*(((9/(8-7))*(6*(5/4)))*3))-(2/1))
(((10*(((9/(8-7))*(6*(5/4)))*3))-2)*1)
(((10*(((9/(8-7))*(6*(5/4)))*3))-2)/1)
(((10*((9/(8-7))*(6*(5/4))))*3)-(2*1))
(((10*((9/(8-7))*(6*(5/4))))*3)-(2/1))
((((10*((9/(8-7))*(6*(5/4))))*3)-2)*1)
((((10*((9/(8-7))*(6*(5/4))))*3)-2)/1)
((10*((9/(8-7))*((6*5)/(4/3))))-(2*1))
((10*((9/(8-7))*((6*5)/(4/3))))-(2/1))
(((10*((9/(8-7))*((6*5)/(4/3))))-2)*1)
(((10*((9/(8-7))*((6*5)/(4/3))))-2)/1)
((10*((9/(8-7))*(((6*5)/4)*3)))-(2*1))
((10*((9/(8-7))*(((6*5)/4)*3)))-(2/1))
(((10*((9/(8-7))*(((6*5)/4)*3)))-2)*1)
(((10*((9/(8-7))*(((6*5)/4)*3)))-2)/1)
((10*(((9/(8-7))*((6*5)/4))*3))-(2*1))
((10*(((9/(8-7))*((6*5)/4))*3))-(2/1))
(((10*(((9/(8-7))*((6*5)/4))*3))-2)*1)
(((10*(((9/(8-7))*((6*5)/4))*3))-2)/1)
(((10*((9/(8-7))*((6*5)/4)))*3)-(2*1))
(((10*((9/(8-7))*((6*5)/4)))*3)-(2/1))
((((10*((9/(8-7))*((6*5)/4)))*3)-2)*1)
((((10*((9/(8-7))*((6*5)/4)))*3)-2)/1)
((10*(((9/(8-7))*(6*5))/(4/3)))-(2*1))
((10*(((9/(8-7))*(6*5))/(4/3)))-(2/1))
(((10*(((9/(8-7))*(6*5))/(4/3)))-2)*1)
(((10*(((9/(8-7))*(6*5))/(4/3)))-2)/1)
((10*((((9/(8-7))*(6*5))/4)*3))-(2*1))
((10*((((9/(8-7))*(6*5))/4)*3))-(2/1))
(((10*((((9/(8-7))*(6*5))/4)*3))-2)*1)
(((10*((((9/(8-7))*(6*5))/4)*3))-2)/1)
(((10*(((9/(8-7))*(6*5))/4))*3)-(2*1))
(((10*(((9/(8-7))*(6*5))/4))*3)-(2/1))
((((10*(((9/(8-7))*(6*5))/4))*3)-2)*1)
((((10*(((9/(8-7))*(6*5))/4))*3)-2)/1)
(((10*((9/(8-7))*(6*5)))/(4/3))-(2*1))
(((10*((9/(8-7))*(6*5)))/(4/3))-(2/1))
((((10*((9/(8-7))*(6*5)))/(4/3))-2)*1)
((((10*((9/(8-7))*(6*5)))/(4/3))-2)/1)
((((10*((9/(8-7))*(6*5)))/4)*3)-(2*1))
((((10*((9/(8-7))*(6*5)))/4)*3)-(2/1))
(((((10*((9/(8-7))*(6*5)))/4)*3)-2)*1)
(((((10*((9/(8-7))*(6*5)))/4)*3)-2)/1)
((10*(((9/(8-7))*6)*(5/(4/3))))-(2*1))
((10*(((9/(8-7))*6)*(5/(4/3))))-(2/1))
(((10*(((9/(8-7))*6)*(5/(4/3))))-2)*1)
(((10*(((9/(8-7))*6)*(5/(4/3))))-2)/1)
((10*(((9/(8-7))*6)*((5/4)*3)))-(2*1))
((10*(((9/(8-7))*6)*((5/4)*3)))-(2/1))
(((10*(((9/(8-7))*6)*((5/4)*3)))-2)*1)
(((10*(((9/(8-7))*6)*((5/4)*3)))-2)/1)
((10*((((9/(8-7))*6)*(5/4))*3))-(2*1))
((10*((((9/(8-7))*6)*(5/4))*3))-(2/1))
(((10*((((9/(8-7))*6)*(5/4))*3))-2)*1)
(((10*((((9/(8-7))*6)*(5/4))*3))-2)/1)
(((10*(((9/(8-7))*6)*(5/4)))*3)-(2*1))
(((10*(((9/(8-7))*6)*(5/4)))*3)-(2/1))
((((10*(((9/(8-7))*6)*(5/4)))*3)-2)*1)
((((10*(((9/(8-7))*6)*(5/4)))*3)-2)/1)
((10*((((9/(8-7))*6)*5)/(4/3)))-(2*1))
((10*((((9/(8-7))*6)*5)/(4/3)))-(2/1))
(((10*((((9/(8-7))*6)*5)/(4/3)))-2)*1)
(((10*((((9/(8-7))*6)*5)/(4/3)))-2)/1)
((10*(((((9/(8-7))*6)*5)/4)*3))-(2*1))
((10*(((((9/(8-7))*6)*5)/4)*3))-(2/1))
(((10*(((((9/(8-7))*6)*5)/4)*3))-2)*1)
(((10*(((((9/(8-7))*6)*5)/4)*3))-2)/1)
(((10*((((9/(8-7))*6)*5)/4))*3)-(2*1))
(((10*((((9/(8-7))*6)*5)/4))*3)-(2/1))
((((10*((((9/(8-7))*6)*5)/4))*3)-2)*1)
((((10*((((9/(8-7))*6)*5)/4))*3)-2)/1)
(((10*(((9/(8-7))*6)*5))/(4/3))-(2*1))
(((10*(((9/(8-7))*6)*5))/(4/3))-(2/1))
((((10*(((9/(8-7))*6)*5))/(4/3))-2)*1)
((((10*(((9/(8-7))*6)*5))/(4/3))-2)/1)
((((10*(((9/(8-7))*6)*5))/4)*3)-(2*1))
((((10*(((9/(8-7))*6)*5))/4)*3)-(2/1))
(((((10*(((9/(8-7))*6)*5))/4)*3)-2)*1)
(((((10*(((9/(8-7))*6)*5))/4)*3)-2)/1)
(((10*((9/(8-7))*6))*(5/(4/3)))-(2*1))
(((10*((9/(8-7))*6))*(5/(4/3)))-(2/1))
((((10*((9/(8-7))*6))*(5/(4/3)))-2)*1)
((((10*((9/(8-7))*6))*(5/(4/3)))-2)/1)
(((10*((9/(8-7))*6))*((5/4)*3))-(2*1))
(((10*((9/(8-7))*6))*((5/4)*3))-(2/1))
((((10*((9/(8-7))*6))*((5/4)*3))-2)*1)
((((10*((9/(8-7))*6))*((5/4)*3))-2)/1)
((((10*((9/(8-7))*6))*(5/4))*3)-(2*1))
((((10*((9/(8-7))*6))*(5/4))*3)-(2/1))
(((((10*((9/(8-7))*6))*(5/4))*3)-2)*1)
(((((10*((9/(8-7))*6))*(5/4))*3)-2)/1)
((((10*((9/(8-7))*6))*5)/(4/3))-(2*1))
((((10*((9/(8-7))*6))*5)/(4/3))-(2/1))
(((((10*((9/(8-7))*6))*5)/(4/3))-2)*1)
(((((10*((9/(8-7))*6))*5)/(4/3))-2)/1)
(((((10*((9/(8-7))*6))*5)/4)*3)-(2*1))
(((((10*((9/(8-7))*6))*5)/4)*3)-(2/1))
((((((10*((9/(8-7))*6))*5)/4)*3)-2)*1)
((((((10*((9/(8-7))*6))*5)/4)*3)-2)/1)
(((10*(9/(8-7)))*(6*(5/(4/3))))-(2*1))
(((10*(9/(8-7)))*(6*(5/(4/3))))-(2/1))
((((10*(9/(8-7)))*(6*(5/(4/3))))-2)*1)
((((10*(9/(8-7)))*(6*(5/(4/3))))-2)/1)
(((10*(9/(8-7)))*(6*((5/4)*3)))-(2*1))
(((10*(9/(8-7)))*(6*((5/4)*3)))-(2/1))
((((10*(9/(8-7)))*(6*((5/4)*3)))-2)*1)
((((10*(9/(8-7)))*(6*((5/4)*3)))-2)/1)
(((10*(9/(8-7)))*((6*(5/4))*3))-(2*1))
(((10*(9/(8-7)))*((6*(5/4))*3))-(2/1))
((((10*(9/(8-7)))*((6*(5/4))*3))-2)*1)
((((10*(9/(8-7)))*((6*(5/4))*3))-2)/1)
((((10*(9/(8-7)))*(6*(5/4)))*3)-(2*1))
((((10*(9/(8-7)))*(6*(5/4)))*3)-(2/1))
(((((10*(9/(8-7)))*(6*(5/4)))*3)-2)*1)
(((((10*(9/(8-7)))*(6*(5/4)))*3)-2)/1)
(((10*(9/(8-7)))*((6*5)/(4/3)))-(2*1))
(((10*(9/(8-7)))*((6*5)/(4/3)))-(2/1))
((((10*(9/(8-7)))*((6*5)/(4/3)))-2)*1)
((((10*(9/(8-7)))*((6*5)/(4/3)))-2)/1)
(((10*(9/(8-7)))*(((6*5)/4)*3))-(2*1))
(((10*(9/(8-7)))*(((6*5)/4)*3))-(2/1))
((((10*(9/(8-7)))*(((6*5)/4)*3))-2)*1)
((((10*(9/(8-7)))*(((6*5)/4)*3))-2)/1)
((((10*(9/(8-7)))*((6*5)/4))*3)-(2*1))
((((10*(9/(8-7)))*((6*5)/4))*3)-(2/1))
(((((10*(9/(8-7)))*((6*5)/4))*3)-2)*1)
(((((10*(9/(8-7)))*((6*5)/4))*3)-2)/1)
((((10*(9/(8-7)))*(6*5))/(4/3))-(2*1))
((((10*(9/(8-7)))*(6*5))/(4/3))-(2/1))
(((((10*(9/(8-7)))*(6*5))/(4/3))-2)*1)
(((((10*(9/(8-7)))*(6*5))/(4/3))-2)/1)
(((((10*(9/(8-7)))*(6*5))/4)*3)-(2*1))
(((((10*(9/(8-7)))*(6*5))/4)*3)-(2/1))
((((((10*(9/(8-7)))*(6*5))/4)*3)-2)*1)
((((((10*(9/(8-7)))*(6*5))/4)*3)-2)/1)
((((10*(9/(8-7)))*6)*(5/(4/3)))-(2*1))
((((10*(9/(8-7)))*6)*(5/(4/3)))-(2/1))
(((((10*(9/(8-7)))*6)*(5/(4/3)))-2)*1)
(((((10*(9/(8-7)))*6)*(5/(4/3)))-2)/1)
((((10*(9/(8-7)))*6)*((5/4)*3))-(2*1))
((((10*(9/(8-7)))*6)*((5/4)*3))-(2/1))
(((((10*(9/(8-7)))*6)*((5/4)*3))-2)*1)
(((((10*(9/(8-7)))*6)*((5/4)*3))-2)/1)
(((((10*(9/(8-7)))*6)*(5/4))*3)-(2*1))
(((((10*(9/(8-7)))*6)*(5/4))*3)-(2/1))
((((((10*(9/(8-7)))*6)*(5/4))*3)-2)*1)
((((((10*(9/(8-7)))*6)*(5/4))*3)-2)/1)
(((((10*(9/(8-7)))*6)*5)/(4/3))-(2*1))
(((((10*(9/(8-7)))*6)*5)/(4/3))-(2/1))
((((((10*(9/(8-7)))*6)*5)/(4/3))-2)*1)
((((((10*(9/(8-7)))*6)*5)/(4/3))-2)/1)
((((((10*(9/(8-7)))*6)*5)/4)*3)-(2*1))
((((((10*(9/(8-7)))*6)*5)/4)*3)-(2/1))
(((((((10*(9/(8-7)))*6)*5)/4)*3)-2)*1)
(((((((10*(9/(8-7)))*6)*5)/4)*3)-2)/1)
(((((10+(((9/8)+7)*(6*5)))*4)-3)*2)-1) !
(((((10+((((9/8)+7)*6)*5))*4)-3)*2)-1) !
(((10*9)/((8-7)/(6*(5/(4/3)))))-(2*1))
(((10*9)/((8-7)/(6*(5/(4/3)))))-(2/1))
((((10*9)/((8-7)/(6*(5/(4/3)))))-2)*1)
((((10*9)/((8-7)/(6*(5/(4/3)))))-2)/1)
(((10*9)/((8-7)/(6*((5/4)*3))))-(2*1))
(((10*9)/((8-7)/(6*((5/4)*3))))-(2/1))
((((10*9)/((8-7)/(6*((5/4)*3))))-2)*1)
((((10*9)/((8-7)/(6*((5/4)*3))))-2)/1)
(((10*9)/((8-7)/((6*(5/4))*3)))-(2*1))
(((10*9)/((8-7)/((6*(5/4))*3)))-(2/1))
((((10*9)/((8-7)/((6*(5/4))*3)))-2)*1)
((((10*9)/((8-7)/((6*(5/4))*3)))-2)/1)
(((10*9)/(((8-7)/(6*(5/4)))/3))-(2*1))
(((10*9)/(((8-7)/(6*(5/4)))/3))-(2/1))
((((10*9)/(((8-7)/(6*(5/4)))/3))-2)*1)
((((10*9)/(((8-7)/(6*(5/4)))/3))-2)/1)
((((10*9)/((8-7)/(6*(5/4))))*3)-(2*1))
((((10*9)/((8-7)/(6*(5/4))))*3)-(2/1))
(((((10*9)/((8-7)/(6*(5/4))))*3)-2)*1)
(((((10*9)/((8-7)/(6*(5/4))))*3)-2)/1)
(((10*9)/((8-7)/((6*5)/(4/3))))-(2*1))
(((10*9)/((8-7)/((6*5)/(4/3))))-(2/1))
((((10*9)/((8-7)/((6*5)/(4/3))))-2)*1)
((((10*9)/((8-7)/((6*5)/(4/3))))-2)/1)
(((10*9)/((8-7)/(((6*5)/4)*3)))-(2*1))
(((10*9)/((8-7)/(((6*5)/4)*3)))-(2/1))
((((10*9)/((8-7)/(((6*5)/4)*3)))-2)*1)
((((10*9)/((8-7)/(((6*5)/4)*3)))-2)/1)
(((10*9)/(((8-7)/((6*5)/4))/3))-(2*1))
(((10*9)/(((8-7)/((6*5)/4))/3))-(2/1))
((((10*9)/(((8-7)/((6*5)/4))/3))-2)*1)
((((10*9)/(((8-7)/((6*5)/4))/3))-2)/1)
((((10*9)/((8-7)/((6*5)/4)))*3)-(2*1))
((((10*9)/((8-7)/((6*5)/4)))*3)-(2/1))
(((((10*9)/((8-7)/((6*5)/4)))*3)-2)*1)
(((((10*9)/((8-7)/((6*5)/4)))*3)-2)/1)
(((10*9)/(((8-7)/(6*5))*(4/3)))-(2*1))
(((10*9)/(((8-7)/(6*5))*(4/3)))-(2/1))
((((10*9)/(((8-7)/(6*5))*(4/3)))-2)*1)
((((10*9)/(((8-7)/(6*5))*(4/3)))-2)/1)
(((10*9)/((((8-7)/(6*5))*4)/3))-(2*1))
(((10*9)/((((8-7)/(6*5))*4)/3))-(2/1))
((((10*9)/((((8-7)/(6*5))*4)/3))-2)*1)
((((10*9)/((((8-7)/(6*5))*4)/3))-2)/1)
((((10*9)/(((8-7)/(6*5))*4))*3)-(2*1))
((((10*9)/(((8-7)/(6*5))*4))*3)-(2/1))
(((((10*9)/(((8-7)/(6*5))*4))*3)-2)*1)
(((((10*9)/(((8-7)/(6*5))*4))*3)-2)/1)
((((10*9)/((8-7)/(6*5)))/(4/3))-(2*1))
((((10*9)/((8-7)/(6*5)))/(4/3))-(2/1))
(((((10*9)/((8-7)/(6*5)))/(4/3))-2)*1)
(((((10*9)/((8-7)/(6*5)))/(4/3))-2)/1)
(((((10*9)/((8-7)/(6*5)))/4)*3)-(2*1))
(((((10*9)/((8-7)/(6*5)))/4)*3)-(2/1))
((((((10*9)/((8-7)/(6*5)))/4)*3)-2)*1)
((((((10*9)/((8-7)/(6*5)))/4)*3)-2)/1)
(((10*9)/(((8-7)/6)/(5/(4/3))))-(2*1))
(((10*9)/(((8-7)/6)/(5/(4/3))))-(2/1))
((((10*9)/(((8-7)/6)/(5/(4/3))))-2)*1)
((((10*9)/(((8-7)/6)/(5/(4/3))))-2)/1)
(((10*9)/(((8-7)/6)/((5/4)*3)))-(2*1))
(((10*9)/(((8-7)/6)/((5/4)*3)))-(2/1))
((((10*9)/(((8-7)/6)/((5/4)*3)))-2)*1)
((((10*9)/(((8-7)/6)/((5/4)*3)))-2)/1)
(((10*9)/((((8-7)/6)/(5/4))/3))-(2*1))
(((10*9)/((((8-7)/6)/(5/4))/3))-(2/1))
((((10*9)/((((8-7)/6)/(5/4))/3))-2)*1)
((((10*9)/((((8-7)/6)/(5/4))/3))-2)/1)
((((10*9)/(((8-7)/6)/(5/4)))*3)-(2*1))
((((10*9)/(((8-7)/6)/(5/4)))*3)-(2/1))
(((((10*9)/(((8-7)/6)/(5/4)))*3)-2)*1)
(((((10*9)/(((8-7)/6)/(5/4)))*3)-2)/1)
(((10*9)/((((8-7)/6)/5)*(4/3)))-(2*1))
(((10*9)/((((8-7)/6)/5)*(4/3)))-(2/1))
((((10*9)/((((8-7)/6)/5)*(4/3)))-2)*1)
((((10*9)/((((8-7)/6)/5)*(4/3)))-2)/1)
(((10*9)/(((((8-7)/6)/5)*4)/3))-(2*1))
(((10*9)/(((((8-7)/6)/5)*4)/3))-(2/1))
((((10*9)/(((((8-7)/6)/5)*4)/3))-2)*1)
((((10*9)/(((((8-7)/6)/5)*4)/3))-2)/1)
((((10*9)/((((8-7)/6)/5)*4))*3)-(2*1))
((((10*9)/((((8-7)/6)/5)*4))*3)-(2/1))
(((((10*9)/((((8-7)/6)/5)*4))*3)-2)*1)
(((((10*9)/((((8-7)/6)/5)*4))*3)-2)/1)
((((10*9)/(((8-7)/6)/5))/(4/3))-(2*1))
((((10*9)/(((8-7)/6)/5))/(4/3))-(2/1))
(((((10*9)/(((8-7)/6)/5))/(4/3))-2)*1)
(((((10*9)/(((8-7)/6)/5))/(4/3))-2)/1)
(((((10*9)/(((8-7)/6)/5))/4)*3)-(2*1))
(((((10*9)/(((8-7)/6)/5))/4)*3)-(2/1))
((((((10*9)/(((8-7)/6)/5))/4)*3)-2)*1)
((((((10*9)/(((8-7)/6)/5))/4)*3)-2)/1)
((((10*9)/((8-7)/6))*(5/(4/3)))-(2*1))
((((10*9)/((8-7)/6))*(5/(4/3)))-(2/1))
(((((10*9)/((8-7)/6))*(5/(4/3)))-2)*1)
(((((10*9)/((8-7)/6))*(5/(4/3)))-2)/1)
((((10*9)/((8-7)/6))*((5/4)*3))-(2*1))
((((10*9)/((8-7)/6))*((5/4)*3))-(2/1))
(((((10*9)/((8-7)/6))*((5/4)*3))-2)*1)
(((((10*9)/((8-7)/6))*((5/4)*3))-2)/1)
(((((10*9)/((8-7)/6))*(5/4))*3)-(2*1))
(((((10*9)/((8-7)/6))*(5/4))*3)-(2/1))
((((((10*9)/((8-7)/6))*(5/4))*3)-2)*1)
((((((10*9)/((8-7)/6))*(5/4))*3)-2)/1)
(((((10*9)/((8-7)/6))*5)/(4/3))-(2*1))
(((((10*9)/((8-7)/6))*5)/(4/3))-(2/1))
((((((10*9)/((8-7)/6))*5)/(4/3))-2)*1)
((((((10*9)/((8-7)/6))*5)/(4/3))-2)/1)
((((((10*9)/((8-7)/6))*5)/4)*3)-(2*1))
((((((10*9)/((8-7)/6))*5)/4)*3)-(2/1))
(((((((10*9)/((8-7)/6))*5)/4)*3)-2)*1)
(((((((10*9)/((8-7)/6))*5)/4)*3)-2)/1)
((((10*9)/(8-7))*(6*(5/(4/3))))-(2*1))
((((10*9)/(8-7))*(6*(5/(4/3))))-(2/1))
(((((10*9)/(8-7))*(6*(5/(4/3))))-2)*1)
(((((10*9)/(8-7))*(6*(5/(4/3))))-2)/1)
((((10*9)/(8-7))*(6*((5/4)*3)))-(2*1))
((((10*9)/(8-7))*(6*((5/4)*3)))-(2/1))
(((((10*9)/(8-7))*(6*((5/4)*3)))-2)*1)
(((((10*9)/(8-7))*(6*((5/4)*3)))-2)/1)
((((10*9)/(8-7))*((6*(5/4))*3))-(2*1))
((((10*9)/(8-7))*((6*(5/4))*3))-(2/1))
(((((10*9)/(8-7))*((6*(5/4))*3))-2)*1)
(((((10*9)/(8-7))*((6*(5/4))*3))-2)/1)
(((((10*9)/(8-7))*(6*(5/4)))*3)-(2*1))
(((((10*9)/(8-7))*(6*(5/4)))*3)-(2/1))
((((((10*9)/(8-7))*(6*(5/4)))*3)-2)*1)
((((((10*9)/(8-7))*(6*(5/4)))*3)-2)/1)
((((10*9)/(8-7))*((6*5)/(4/3)))-(2*1))
((((10*9)/(8-7))*((6*5)/(4/3)))-(2/1))
(((((10*9)/(8-7))*((6*5)/(4/3)))-2)*1)
(((((10*9)/(8-7))*((6*5)/(4/3)))-2)/1)
((((10*9)/(8-7))*(((6*5)/4)*3))-(2*1))
((((10*9)/(8-7))*(((6*5)/4)*3))-(2/1))
(((((10*9)/(8-7))*(((6*5)/4)*3))-2)*1)
(((((10*9)/(8-7))*(((6*5)/4)*3))-2)/1)
(((((10*9)/(8-7))*((6*5)/4))*3)-(2*1))
(((((10*9)/(8-7))*((6*5)/4))*3)-(2/1))
((((((10*9)/(8-7))*((6*5)/4))*3)-2)*1)
((((((10*9)/(8-7))*((6*5)/4))*3)-2)/1)
(((((10*9)/(8-7))*(6*5))/(4/3))-(2*1))
(((((10*9)/(8-7))*(6*5))/(4/3))-(2/1))
((((((10*9)/(8-7))*(6*5))/(4/3))-2)*1)
((((((10*9)/(8-7))*(6*5))/(4/3))-2)/1)
((((((10*9)/(8-7))*(6*5))/4)*3)-(2*1))
((((((10*9)/(8-7))*(6*5))/4)*3)-(2/1))
(((((((10*9)/(8-7))*(6*5))/4)*3)-2)*1)
(((((((10*9)/(8-7))*(6*5))/4)*3)-2)/1)
(((((10*9)/(8-7))*6)*(5/(4/3)))-(2*1))
(((((10*9)/(8-7))*6)*(5/(4/3)))-(2/1))
((((((10*9)/(8-7))*6)*(5/(4/3)))-2)*1)
((((((10*9)/(8-7))*6)*(5/(4/3)))-2)/1)
(((((10*9)/(8-7))*6)*((5/4)*3))-(2*1))
(((((10*9)/(8-7))*6)*((5/4)*3))-(2/1))
((((((10*9)/(8-7))*6)*((5/4)*3))-2)*1)
((((((10*9)/(8-7))*6)*((5/4)*3))-2)/1)
((((((10*9)/(8-7))*6)*(5/4))*3)-(2*1))
((((((10*9)/(8-7))*6)*(5/4))*3)-(2/1))
(((((((10*9)/(8-7))*6)*(5/4))*3)-2)*1)
(((((((10*9)/(8-7))*6)*(5/4))*3)-2)/1)
((((((10*9)/(8-7))*6)*5)/(4/3))-(2*1))
((((((10*9)/(8-7))*6)*5)/(4/3))-(2/1))
(((((((10*9)/(8-7))*6)*5)/(4/3))-2)*1)
(((((((10*9)/(8-7))*6)*5)/(4/3))-2)/1)
(((((((10*9)/(8-7))*6)*5)/4)*3)-(2*1))
(((((((10*9)/(8-7))*6)*5)/4)*3)-(2/1))
((((((((10*9)/(8-7))*6)*5)/4)*3)-2)*1)
((((((((10*9)/(8-7))*6)*5)/4)*3)-2)/1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment